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.
6404 Discussions

Could not create an nGraph Constant for an ONNX Constant node.

andife
Novice
529 Views

Hello,

I'm trying to execute a custom onnx model with openvino (openvino 2021.4.2).

I use 

ie = IECore()

exec_net = ie.load_network(network=r'xxx.onnx', device_name=args.device)

 

I got the following messages

 

[WARN] 2022-09-06T10:43:16z frontend/onnx_import/src/op/constant.cpp 35
Could not create an nGraph Constant for an ONNX Constant node. Constant with a 0 value was created instead.
Verify if the ONNX Constant node contains a correct number of elements matching the node's shape.
Detailed error:
Check 'values.size() == 1 || values.size() == shape_size(m_shape)' failed at core/include/ngraph/op/constant.hpp:59:
While validating node 'v0::Constant Constant_2671 () -> (f32{})' with friendly_name 'Constant_2671':
Did not get the expected number of literals for a constant of shape Shape{} (got 0, expected 1).

 

What does that warning mean? Can someone provide an explanation in more understandable words? Does is depend on the onnx version?

 

According to [Bug]Could not create an nGraph Constant for an ONNX Constant node. Constant with a 0 value was created instead. · Issue #6762 · openvinotoolkit/openvino (github.com)
this could be a problem?

0 Kudos
2 Replies
Wan_Intel
Moderator
487 Views

Hi Andife,

Thanks for reaching out to us.

 

Referring to this GitHub thread, the error you encountered: “Could not create an nGraph Constant for an ONNX Constant node. Constant with a 0 value was created instead” was due to there is no value for a Constant node in the ONNX model.

 

The ONNX importer will create a Constant with value ‘0’ instead. For more information, please refer to Pull request here for more information.

 

 

Regards,

Wan


0 Kudos
Wan_Intel
Moderator
450 Views

Hi Andife,

Thanks for your question.


This thread will no longer be monitored since we have provided information. 

If you need any additional information from Intel, please submit a new question.

 

 

Best regards,

Wan


0 Kudos
Reply