Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

Error while converting ONNX file to OpenVino IR model

rohan
Novice
2,093 Views

 

I have trained a model on custom dataset using YOLOV5L weights on pytorch framework and then i exported the pytorch model to an .onnx model. Now that i try to convert this onnx model to openvino IR model , it is showing me the following errors :

[ ERROR ] Cannot infer shapes or values for node "Resize_242".
[ ERROR ] operands could not be broadcast together with shapes (4,) (0,)
[ ERROR ]
[ ERROR ] It can happen due to bug in custom shape infer function <function UpsampleOp.upsample_infer at 0x0000012F1C41C5E8>.
[ 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).
[ ERROR ] Run Model Optimizer with --log_level=DEBUG for more information.
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.PartialInfer.PartialInfer'>): Stopped shape/value propagation at "Resize_242" node.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38.

Following was the command i used :

"C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo.py" --input_model last_yolov5l_results_416.onnx --input_shape [1,3,416,416]

Also, is there a way to skip any layer in the network?

rohan_0-1594810707914.png

After this, I reinstalled the latest openvino toolkit version and did the same operation and now I'm getting this error : 

rohan_1-1594816982860.png

 

 

0 Kudos
1 Solution
Max_L_Intel
Moderator
2,080 Views

Hi @rohan 

YOLOv5 is currently not an officially supported topology by OpenVINO toolkit. Please see the list of validated ONNX and PyTorch topologies here https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html 

As indicated on the picture you attached, you model uses Resize Opset-12 operation that is not supported by Model Optimizer to convert (as well as Resize Opset-11). However, as possible workaround you can try to use other PyTorch resize-like operation and convert the model with Resize Opset-10 operation which is supported.

Hope this helps.
Best regards, Max.

View solution in original post

2 Replies
Max_L_Intel
Moderator
2,081 Views

Hi @rohan 

YOLOv5 is currently not an officially supported topology by OpenVINO toolkit. Please see the list of validated ONNX and PyTorch topologies here https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html 

As indicated on the picture you attached, you model uses Resize Opset-12 operation that is not supported by Model Optimizer to convert (as well as Resize Opset-11). However, as possible workaround you can try to use other PyTorch resize-like operation and convert the model with Resize Opset-10 operation which is supported.

Hope this helps.
Best regards, Max.

rohan
Novice
2,036 Views

Thankyou so much for your review. Is there any way in openvino to convert the model with Resize Opset-10 operation or do i need to do it from any other source?

Also, there is a folder named "extension_generator", that should be present in the installation directory of openvino, but i don't have it. How to get it?

0 Kudos
Reply