從我的理解,tensorflow的freeze_graph.py應該支持新的關卡格式,我應該只可以使用類似欲以FailedPreconditionError freeze_graph.py結果:
freeze_graph.py --input_saver ./checkpoints/model-49-295 --output_graph ./graph.pb --output_node_names "predictions:0"
只是要清晰,
ls ./checkpoints
checkpoint
model-49-295.data-00000-of-00001
model-49-295.index
model-49-295.meta
然而,當我這樣做,我得到了以下錯誤:
Traceback (most recent call last):
File "~/.local/lib/python3.5/site-packages/tensorflow/python/tools/freeze_graph.py", line 255, in <module>
app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "~/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "~/.local/lib/python3.5/site-packages/tensorflow/python/tools/freeze_graph.py", line 187, in main
FLAGS.variable_names_blacklist)
File "~/.local/lib/python3.5/site-packages/tensorflow/python/tools/freeze_graph.py", line 165, in freeze_graph
input_graph_def = _parse_input_graph_proto(input_graph, input_binary)
File "~/.local/lib/python3.5/site-packages/tensorflow/python/tools/freeze_graph.py", line 134, in _parse_input_graph_proto
text_format.Merge(f.read(), input_graph_def)
File "~/.local/lib/python3.5/site-packages/tensorflow/python/lib/io/file_io.py", line 125, in read
pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
File "/usr/lib/python3.5/contextlib.py", line 66, in __exit__
next(self.gen)
File "~/.local/lib/python3.5/site-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.FailedPreconditionError: .
我真的被這個迷惑,因爲.
似乎並不像一個非常有用的錯誤代碼,所有的引用到FailedPreconditionError我可以找到有類似FailedPreconditionError: Attempting to use uninitialized value ...
任何人有任何線索,這是怎麼回事呢?
我不確定,但我想你錯過了_space_ ** - input_saver./checkpoints/model-49-295 ** – james
糟糕,不知道這是怎麼回事。我運行的實際命令有空間(我現在剛剛確定,同樣的錯誤)。 我更新了這個帖子來解決這個問題 – user2640224