tensorflow——调试Image_retrain出现问题一

下载flower图片后,直接运行python tensorflow/examples/image_retraining/retrain.py出现错误:

Looking for images in ‘flower’
Traceback (most recent call last):
File “retrain.py”, line 1138, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py”, line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File “retrain.py”, line 832, in main
FLAGS.validation_percentage)
File “retrain.py”, line 152, in create_image_lists
file_list.extend(gfile.Glob(file_glob))
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py”, line 334, in get_matching_files
compat.as_bytes(single_filename), status)
File “/usr/lib/python2.7/contextlib.py”, line 24, in exit
self.gen.next()
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py”, line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: flower

待解决

解决:后来发现,直接运行retrain.py会出现这这种问题,猜测是因为单单启动retrain.py会漏掉什么东西,后来运行
bazel-bin/tensorflow/examples/image_retraining/retrain –image_dir ~/flower_photos
训练成功。

果然是漏掉了什么东西。
运行python retrain.py –image_dir ~/flower_photos
运行成功

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值