models icon indicating copy to clipboard operation
models copied to clipboard

how to generate pb file from ckpt files?

Open samsun639 opened this issue 9 years ago • 10 comments

I have untar mobilenet_v1_1.0_224_2017_06_14.tar.gz. there are three ckpt files there. -rw-rw-r-- 1 292639 5000 67903136 Jun 14 12:15 mobilenet_v1_1.0_224.ckpt.data-00000-of-00001 -rw-rw-r-- 1 292639 5000 19954 Jun 14 12:15 mobilenet_v1_1.0_224.ckpt.index -rw-rw-r-- 1 292639 5000 4319476 Jun 14 12:15 mobilenet_v1_1.0_224.ckpt.meta

How can I convert these ckpt file to pb file?

Thanks a lot!

samsun639 avatar Aug 02 '17 02:08 samsun639

use the export_inference_graph.py file. Please look at g3doc/exporting_models.md "Exporting a trained model for inference"

heroinlin avatar Aug 02 '17 02:08 heroinlin

@heroinlin could you point out where to find "export_inference_graph.py"? I searched but not found. Thanks.

samsun639 avatar Aug 02 '17 03:08 samsun639

./models/object_detection/export_inference_graph.py 1501651501 1 can you see it ?

heroinlin avatar Aug 02 '17 05:08 heroinlin

Use it by this way: 1501651783 1

heroinlin avatar Aug 02 '17 05:08 heroinlin

See it now, thanks!

samsun639 avatar Aug 02 '17 06:08 samsun639

@heroinlin hello, I use the export_inference_graph.py,but it failed ,it said

Exception AttributeError: AttributeError("'NoneType' object has no attribute 'ScopedTFStatus'",) in <bound method Context.del of <tensorflow.python.eager.context.Context object at 0x7f5483845990>> ignored

what is wrong with it?

LiangHao92 avatar Aug 17 '17 08:08 LiangHao92

@samsun639 hello, have you succeed? I get the error Exception AttributeError: AttributeError("'NoneType' object has no attribute 'ScopedTFStatus'",) in <bound method Context.del of <tensorflow.python.eager.context.Context object at 0x7f5483845990>> ignored and my order is python export_inference_graph.py --input_type image_tensor --pipeline_config_path /home/seven/ssd_mobilenets/models/ssd_mobilenet_v1_pets.config --trained_checkpoint_prefix /home/seven/ssd_mobilenets/result/model.ckpt-544830 --output_directory /home/seven/ssd_mobilenets/pb

is there any wrong

LiangHao92 avatar Aug 17 '17 08:08 LiangHao92

@LiangHao92 Hi, how to get "ssd_mobilenet_v1_pets.config" file? Thank you very much!

violet17 avatar Apr 03 '19 11:04 violet17

@LiangHao92 oh, I found it. Thank you anyway. https://github.com/tensorflow/models/tree/master/research/object_detection/samples/configs

violet17 avatar Apr 03 '19 12:04 violet17

Hello! I'm looking to get a frozen pb of the im2txt model, but I can't seem to find the config associated

https://github.com/tensorflow/models/tree/master/research/im2txt

GantMan avatar Sep 19 '19 21:09 GantMan