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

Unable to convert Pytorch model to IR with multiple inputs

EBBIAV
Beginner
1,131 Views

I am currently unable to convert a Pytorch model with two inputs to IR. When I try to convert from ONNX to IR I get the following error:

 

[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.front.user_data_repack.UserDataRepack'>): No node with name 0

As argument for the model optimizer is use the input names 0,1 as suggested in another post:

--input "0,1" 

 

For the conversion to ONNX  I use the following arguments:

torch.onnx.export(
model,
(input1, input2),
f'outputdir/model.onnx',
input_names=["0", "1"],
opset_version=9,
do_constant_folding=True

Do you know why this happens?  

0 Kudos
4 Replies
Wan_Intel
Moderator
1,075 Views

Hi Ebbiav,

Thank you for reaching out to us!


The error you encountered: “No node name with 0” was due to Model Optimizer tried to access a node that does not exist. This could happen if you have incorrectly specified placeholder, input, or output node names.


Could you please check the input nodes of your ONNX model with Netron?


If the input nodes are 0 and 1, please share your PyTorch model, conversion scripts, and conversion command with us for further investigation.



Regards,

Wan


0 Kudos
EBBIAV
Beginner
1,039 Views

Hi Wan,

Thanks for your reply!

 

I checked it with Netron. While my output names seem to be correctly, I cannot find the names of the input nodes (see picture below).

EBBIAV_0-1634714657888.png

This is my current script for onnx conversion:

torch.onnx.export(
model,
(input1, input2),
f'{OUTPUT_DIR.as_posix()}/{model.__class__.__name__}.onnx',
input_names=["0", "1"],
output_names=["anon_faces", "affin_matrices"],
opset_version=9,
do_constant_folding=True
)

I can also send other information, if that would help.

 

Regards,

Enrico

0 Kudos
EBBIAV
Beginner
1,020 Views

The problem seems to be due to a numpy conversion of the tensor in the model. Thus, this post can be closed. Thanks for you help

0 Kudos
Wan_Intel
Moderator
982 Views

Hi Ebbiav,

Thanks for your question.


We noticed that you would like to close this post.

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



Regards,

Wan


0 Kudos
Reply