how to convert .ckpt file to .pb

Seven.L picture Seven.L · Aug 17, 2017 · Viewed 8.1k times · Source

I use ssd_mobilenets in Object detection API to train my own model, and get .ckpt files. It works well on my computer, but now I want to use the model on my phone. So, I need convert it to .pb file. I do not know how to do it, can any one help? By the way, the graph of ssd_mobilenets is complex, I can not find which is the output of model. Is there any one knowing the name of the output?

Answer

Salman Ghauri picture Salman Ghauri · May 3, 2018

Use export_inference_graph.py to convert model checkpoint file into a .pb file.

python tensorflow_models/object_detection/export_inference_graph.py \
--input_type image_tensor \
--pipeline_config_path architecture_used_while_training.config \
--trained path_to_saved_ckpt/model.ckpt-NUMBER \
--output_directory model/