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