我正在尝试使用我自己的课程重新训练冰点模型。
我在做什么
我的目录包含
等图像我运行以下命令
`python ~/tensorflow/tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tmp/bottlenecks_new \
--output_graph= output/retrained_graph.pb \
--output_labels= output/retrained_labels.txt \
--image_dir ~/newimage_dir \
--how_many_training_steps 10000 \
--random_crop=8 \
--random_scale=8 \
--random_brightness=8 \
--train_batch_size=64`
结果
我接受过网络培训,测试准确率为94.6%,但有错误。
回溯
`Final test accuracy = 94.6% (N=613)
Converted 2 variables to const ops.
Traceback (most recent call last):
File "/home/hannan/tensorflow/tensorflow/examples/image_retraining/retrain.py", line 1061, in <module> tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/hannan/tensorflow/tensorflow/examples/image_retraining/retrain.py", line 902, in main
f.write(output_graph_def.SerializeToString())
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 98, in write self._prewrite_check()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 84, in _prewrite_check
compat.as_bytes(self.__name), compat.as_bytes(self.__mode), 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 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.FailedPreconditionError
`
我尝试了什么
我已卸载tensorflow并从源代码重新安装,工作正常。我已经搜索了错误,只有我理解的是我遇到的错误是由于一些un初始化变量。但是从stacktrace我无法解决错误。