如何将.ckpt文件转换为.pb [英] how to convert .ckpt file to .pb
本文介绍了如何将.ckpt文件转换为.pb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在对象检测API中使用ssd_mobilenets来训练自己的模型,并获取.ckpt文件.它可以在我的计算机上正常工作,但是现在我想在手机上使用该模型.因此,我需要将其转换为.pb文件.我不知道该怎么做,请问有什么可以帮助的吗?顺便说一句,ssd_mobilenets的图很复杂,我找不到哪个是模型的输出.有谁知道输出的名称吗?
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?
推荐答案
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/
这篇关于如何将.ckpt文件转换为.pb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文