tensorflow api训练3(ckpt转成pb和pbtxt)完结

9. 将训练好的ckpt模型转成pb模型

我们只需要传入3个数据,一个是config路径,这里的config是我们训练时得到了,也可以用自己改的那个,ckpt路径和次数,输出的路径

python object_detection/export_inference_graph.py --input_type=image_tensor --pipeline_config_path=I:\persontrain\test3\pipeline.config --trained_checkpoint_prefix=I:\persontrain\test3\model.ckpt-25922 --output_directory=I:/persontrain/test3

回车之后就会生成pb模型,

10. 利用pb模型生成opencv dnn模块支持的pbtxt

进入下面的路径,然后cmd
在这里插入图片描述

python tf_text_graph_ssd.py --input I:\persontrain\test3\frozen_inference_graph.pb --output I:\persontrain\test3\graph.pbtxt --config I:\persontrain\test3\pipeline.config

11. python和c++都测试成功

在这里插入图片描述

发布了19 篇原创文章 · 获赞 9 · 访问量 4786

猜你喜欢

转载自blog.csdn.net/weixin_44868057/article/details/105372066