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

Concat input shapes do not match.Shape is not defined for output 0 of "Concat_4".

Vishnu_T
Novice
1,470 Views

Hi Team,

   I try to optimize the custom pytorch model using openvino model optimizer.

  First I convert the pytorch model into ONNX format. Then I try to optimize the model using openvino toolkit.

 convert from pytorch to ONNX input parameter:

  input shape = [1,640,640,3]

  batch = 1

 convert ONNX to IR(xml,bin) input parameter:

 input shape = [1,640,640,3]

Error:

[ ERROR ]  Concat input shapes do not match
[ ERROR ]  Shape is not defined for output 0 of "Concat_4".
[ ERROR ]  Cannot infer shapes or values for node "Concat_4".
[ ERROR ]  Not all output shapes were inferred or fully defined for node "Concat_4".
 For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #40.
[ ERROR ]
[ ERROR ]  It can happen due to bug in custom shape infer function <function concat_infer at 0x00000237F20939D8>.
[ 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 "Concat_4" 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.

 

As per this error log I verified the input shape of the model as input parameter. Both pytorch,onnx shape is equal.

I searched in the intel community form for similar issue,I got the  below mentioned link.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/convert-onnx-to-xml-bin-it-show-me-that-Concat-input-shapes-do/m-p/675361#M3847

I try to solve the issue by our custom model.I couldn't able to solve this issue.I have attached the full error log and custom code for your reference.

 

Attached File Details:

Error Log in Debug mode : concat_4_error_log.txt

Code for custom concat function :

custom files.zip

      common.py - contains concat function

 

 

  

0 Kudos
1 Solution
Munesh_Intel
Moderator
1,441 Views

Hi Vishnu,


Is your custom model based on YoloV5 architecture?

OpenVINO officially supports YoloV1, YoloV2 and YoloV3 only.

YoloV5 is not officially supported by OpenVINO.


Moreover, GhostNet using PyTorch is not supported officially by OpenVINO.

Details about supported PyTorch models are available at the

https://docs.openvinotoolkit.org/2020.4/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html#supported_pytorch_models_via_onnx_conversion


Regards,

Munesh


View solution in original post

0 Kudos
2 Replies
Munesh_Intel
Moderator
1,442 Views

Hi Vishnu,


Is your custom model based on YoloV5 architecture?

OpenVINO officially supports YoloV1, YoloV2 and YoloV3 only.

YoloV5 is not officially supported by OpenVINO.


Moreover, GhostNet using PyTorch is not supported officially by OpenVINO.

Details about supported PyTorch models are available at the

https://docs.openvinotoolkit.org/2020.4/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html#supported_pytorch_models_via_onnx_conversion


Regards,

Munesh


0 Kudos
Munesh_Intel
Moderator
1,416 Views

Hi Vishnu,


This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Regards,

Munesh


0 Kudos
Reply