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 with Clamp function while converting ONNX model to OpenVino IR

Sharma__Divyanshu
New Contributor I
1,336 Views

Hi!

I'm trying to convert an ONNX representation of the PMTD model, but I've run into an error:

AssertionError: Clamp should have exactly three inputs, but it has 2

The ONNX model seems to work fine, and I've supplied the correct input shape as the input_shape argument. 

I would appreciate any help. Thanks!

Labels (1)
0 Kudos
1 Solution
Sharma__Divyanshu
New Contributor I
1,320 Views

Hi @Munesh_Intel 

Thank you so much for replying. I figured it out. Turns out that either min or max in PyTorch's clamp function is optional. So, one of the two was missing in my code. I passed both the parameters and the error went away.

Thanks and Regards! 

View solution in original post

0 Kudos
3 Replies
Munesh_Intel
Moderator
1,324 Views

Hi Divyanshu,


From what I can see, the node “Clip_678” has two inputs and lacking one more input. The clamp function expects three inputs instead.

More information is available at the following page:

https://docs.openvinotoolkit.org/2020.4/openvino_docs_ops_activation_Clamp_1.html


Also, Pyramid Mask Text Detector (PMTD) is not supported officially by OpenVINO.

However, you can try validating on your end.


Alternatively, I would also suggest you try inferencing using the function InferenceEngine::Core::ReadNetwork to read ONNX models via the Inference Engine Core API.

(For your information, Inference Engine enables reading ONNX models via the Inference Engine Core API since OpenVINO™ 2020.4 version)


More information is available at the following page:

https://docs.openvinotoolkit.org/2020.4/classInferenceEngine_1_1Core.html#ac716dda382aefd09264b60ea4...


Regards,

Munesh.



0 Kudos
Sharma__Divyanshu
New Contributor I
1,321 Views

Hi @Munesh_Intel 

Thank you so much for replying. I figured it out. Turns out that either min or max in PyTorch's clamp function is optional. So, one of the two was missing in my code. I passed both the parameters and the error went away.

Thanks and Regards! 

0 Kudos
Munesh_Intel
Moderator
1,306 Views

Hi Divyanshu,

This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.


Regards,

Munesh


0 Kudos
Reply