更正模型優化指令,將 YOLOv5 ONNX 模型轉換為 IR 格式。
- 將 YOLOv5 ONNX 模型轉換為 IR 格式:
python /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py --input_model "model.onnx" --output_dir "cur_folder/"
- 收到錯誤:
[ ERROR ] The ExpandDims node Unsqueeze_583 has more than 1 input
[ ERROR ] Cannot infer shapes or values for node "Slice_4".
[ ERROR ] Output shape: [0 3 0 0] of node "Slice_4" contains non-positive values
[ ERROR ] It can happen due to bug in custom shape infer function .
[ ERROR ] Or because the node inputs have incorrect values/shapes.
[ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
YOLOv5 中有三個輸出節點,所有節點都需要在命令中指定:
模型優化指令: python mo.py --input_model model.onnx --輸出 --input_shape [1,3,512,512]
使用 Netron 視覺化 YOLOv5 ONNX 重量。