我正在尝试使用tensorflow for poets训练我的图像识别模型。它是为鲜花数据的示例案例构建的,也会生成瓶颈,但是当我尝试为另一个测试案例重新训练它时(我在一个名为tf_files的文件夹中创建了四个文件夹,分别是钱德勒、达斯、罗斯和乔伊,这个文件夹就在我的家里)
当我运行此命令时
python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files我得到了这个错误
InvalidArgumentError (see above for traceback): Invalid JPEG data, size
43[[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=3,
dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=false,
_device="/job:localhost/replica:0/task:0/cpu:0"](_recv_DecodeJpeg
/contents_0)]]和许多警告
但是,当我运行上面的命令时,只是为了花标准示例
python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /flower_photos我没有得到任何错误的.My模型重新训练,我得到了一个预测
我是这个领域的新手,请指导我哪里错了,是安装错误还是别的什么
发布于 2017-07-05 20:26:37
您得到的错误是因为您的数据集中可能有一些png格式的图像。另一方面,花朵数据集包含所有jpeg格式的图像。
此外,编写retrain.py是为了处理jpeg格式的图像。您可能想要了解有关处理png图像的更多信息,请关注this thread
https://stackoverflow.com/questions/43453005
复制相似问题