New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node [Div] parse error: Different shapes case is not supported with constant inputs: Div in function 'parseMul' #21355
Comments
Follow the issue's template. Upgrade first. |
@alalek Now the template is ok? I have OpenCV 4.5.4 installed. |
@alalek I hope now the template is fine. Please help me with the issue. |
Please align versions. Please attach |
@alalek
I have also attached a link to the generator_model.onnx file https://drive.google.com/file/d/1epWKi7fX_Dcq2upN4U_FNddpcgf9gO86/view?usp=sharing |
no access to the file. |
@alalek https://drive.google.com/file/d/1epWKi7fX_Dcq2upN4U_FNddpcgf9gO86/view?usp=sharing |
@alalek now the files available to you? or still need access |
@RAJA-PARIKSHAT Arithmetic layers have been reworked in OpenCV. Is the issue still relevant for 4.9.0? |
System information (version)
Detailed description
I am running a PyTorch model FOMM following the GitHub: https://github.com/AliaksandrSiarohin/first-order-model
I have used the pre-trained weights, the link can be found in the above link.
I want to convert the generator model to ONNX and then run it using OpenCV.
I successfully converted the model into ONNX format but getting error when reading through opencv
[ERROR:0] global /tmp/pip-req-build-th1mncc2/opencv/modules/dnn/src/onnx/onnx_importer.cpp (718) handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 1 outputs: [Div]:(268)
Traceback (most recent call last):
File "opencv_inference.py", line 4, in
net = cv2.dnn.readNetFromONNX("/home/parikshat/Parikshat_Office/codes/generator_model_list.onnx")
cv2.error: OpenCV(4.5.4) /tmp/pip-req-build-th1mncc2/opencv/modules/dnn/src/onnx/onnx_importer.cpp:739: error: (-2:Unspecified error) in function 'handleNode'
Steps to reproduce
I modified generator.py file from above github
You can see in the forward pass of the generator, it takes three inputs, these are all fixed shapes inputs i.e
source: (1,3,256,256)
kp_driving: (1,10,2)
kp_source: (1,10,2)
and output is also a 5 element list with fixed-sized tensors.
Now when I run the following code in other .py file importing OcclussionAwareGenerator:
It compiles the model in ONNX format but if I run the following, I get the error
The model is running in ONNX runtime, basically, I want to run the model on CPU, for that, I want to run OpenCV inference as it will run efficiently.
Issue submission checklist
The text was updated successfully, but these errors were encountered: