Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5771 Discussions

Error with Clamp function while converting ONNX model to OpenVino IR

Sharma__Divyanshu
New Contributor I
602 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
586 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

3 Replies
Munesh_Intel
Moderator
590 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.



Sharma__Divyanshu
New Contributor I
587 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! 

Munesh_Intel
Moderator
572 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


Reply