在使用自己的数据集做训练时,用到一个retrain.py的文件,之后通过批处理文件运行
以下是批处理文件代码:
python D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py ^
--bottleneck_dir bottleneck ^
--how_many_training_steps 200 ^
--model_dir D:\python\Anaconda\envs\tensorflow\inception_model ^
--output_graph output_graph.pb ^
--output_labels output_labels.txt ^
--image_dir data/train/
pause
调用时,报了
File "D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py", line 1313, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "D:\python\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py", line 982, in main
class_count = len(image_lists.keys())
AttributeError: 'NoneType' object has no attribute 'keys'
错误最后是说982行缺少keys属性,但不知如何修改
retrain代码太长,只能把链接发上来