yolov5中pt转openvino
newsun-boki Lv3

yolov5中pt转openvino

由于我发现我每次转一次我都要重新google一遍,感觉我贫瘠的大脑无法记下这几条简单的命令,所以记录一下。

pt 转 onnx

在yolov5的路径下使用models/export.py转换,默认会放到和yolov5s.pt同一路径下。

1
python models/export.py --weights polygon_best.pt --img 640 --batch 1

onnx 转 openvino

先切换到指定目录下在运行python程序

1
2
3
cd /opt/intel/openvino_2021/deployment_tools/model_optimizer

python mo.py --input_model ~/rm/polygon-weights/640-n/polygon_best.onnx --input_shape [1,3,640,640] --data_type FP32 --output_dir ~/rm/polygon-weights/640-n
  • Post title:yolov5中pt转openvino
  • Post author:newsun-boki
  • Create time:2021-11-28 18:10:07
  • Post link:https://github.com/newsun-boki2021/11/28/yolov5-openvino/
  • Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.