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++都測試成功

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章