Hi,
I have completed all installation related steps and tried to create .pb file from checkpoint files using
python3 export_inference_graph.py --input_type image_tensor --pipeline_config_path inceptionv2/pipeline.config --trained_checkpoint_prefix inceptionv2/model.ckpt --output_directory trained-inference-graphs/output_inference_graph_v1.pb
but getting error :
_2019-12-26 18:04:24.562143: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open inceptionv2/model.ckpt: 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?
2019-12-26 18:04:24.562163: W tensorflow/core/framework/op_kernel.cc:1192] Data loss: Unable to open table file inceptionv2/model.ckpt: 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?
Traceback (most recent call last):
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
return fn(*args)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
status, run_metadata)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file inceptionv2/model.ckpt: 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?
[[Node: save/RestoreV2_356 = RestoreV2[dtypes=[DT_INT64], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_356/tensor_names, save/RestoreV2_356/shape_and_slices)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "export_inference_graph.py", line 119, in
tf.app.run()
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "export_inference_graph.py", line 115, in main
FLAGS.output_directory, input_shape)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/LiveFlowchart_Symbol_detection/faster-rcnn-graphics/tf-models/research/object_detection/exporter.py", line 427, in export_inference_graph
input_shape, optimize_graph, output_collection_name)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/LiveFlowchart_Symbol_detection/faster-rcnn-graphics/tf-models/research/object_detection/exporter.py", line 375, in _export_inference_graph
trained_checkpoint_prefix=checkpoint_to_use)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/LiveFlowchart_Symbol_detection/faster-rcnn-graphics/tf-models/research/object_detection/exporter.py", line 320, in _write_graph_and_checkpoint
saver.restore(sess, trained_checkpoint_prefix)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1666, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1120, in _run
feed_dict_tensor, options, run_metadata)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
options, run_metadata)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file inceptionv2/model.ckpt: 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?
[[Node: save/RestoreV2_356 = RestoreV2[dtypes=[DT_INT64], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_356/tensor_names, save/RestoreV2_356/shape_and_slices)]]
Caused by op 'save/RestoreV2_356', defined at:
File "export_inference_graph.py", line 119, in
tf.app.run()
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "export_inference_graph.py", line 115, in main
FLAGS.output_directory, input_shape)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/LiveFlowchart_Symbol_detection/faster-rcnn-graphics/tf-models/research/object_detection/exporter.py", line 427, in export_inference_graph
input_shape, optimize_graph, output_collection_name)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/LiveFlowchart_Symbol_detection/faster-rcnn-graphics/tf-models/research/object_detection/exporter.py", line 375, in _export_inference_graph
trained_checkpoint_prefix=checkpoint_to_use)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/LiveFlowchart_Symbol_detection/faster-rcnn-graphics/tf-models/research/object_detection/exporter.py", line 316, in _write_graph_and_checkpoint
tf.import_graph_def(inference_graph_def, name='')
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 313, in import_graph_def
op_def=op_def)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
op_def=op_def)
File "/home/soumitra/PycharmProjects/LiveFlowchartProject/fc_venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1470, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
DataLossError (see above for traceback): Unable to open table file inceptionv2/model.ckpt: 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?
[[Node: save/RestoreV2_356 = RestoreV2[dtypes=[DT_INT64], _device="/job:localhost/replica:0/task:0/device:CPU:0"](arg_save/Const_0_0, save/RestoreV2_356/tensor_names, save/RestoreV2_356/shape_and_slices)]]
I googled the error and I suspect it can be due to tensorflow version mismatch between the version used to train the model and the version used for freezing the graph or creating .pb file.
Can you please share requirements.txt file?
I almost tried with all tensorflow versions but no respite.
Also, the jupyter notebook present tf-models/research/object_detection/ is also shows error -
unreadable notebook jupyter AttributeError('metadata',)
Thanks in advance.