天天看點

【Tensorflow】tensorflow.python.framework.errors_impl.DataLossError: not an sstable(bad magic number)

在使用tensorflow的模型固化工具freeze.graph.py

python temsorflow/python/tools/freeze_graph.py \
--input_graph=graph.pb \
--input_checkpoint=model.ckpt.data-00000-of-00001 \
--output_graph=freeze_graph.pb \
--output_node_name=logits/BiasAdd
           

時,報如下錯誤:

tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file model.ckpt.data-00000-of-00001: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
           

這個錯誤是因為--input_checkpoint的名字搞錯了,後面的.data-00000-of-00001不應該寫。

改正之後

python temsorflow/python/tools/freeze_graph.py \
--input_graph=graph.pb \
--input_checkpoint=model.ckpt \
--output_graph=freeze_graph.pb \
--output_node_name=logits/BiasAdd
           

繼續閱讀