Assertion failed (inputs.size()) in cv::dnn::dnn::Layer::getMemoryShapes, file opencv\modules\dnn\src\dnn.cpp, line 3616

asked 2019-06-06 22:08:56 -0600

Aeroxander gravatar image

updated 2019-06-09 20:23:09 -0600

So I'm getting this error when reading an ONNX model with readNetFromONNX:

OpenCV(4.1.0) Error: Assertion failed (inputs.size()) in cv::dnn::dnn4_v20190122::Layer::getMemoryShapes, file c:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\dnn.cpp, line 3616

Here is the standalone project: https://github.com/Aeroxander/decoder...

Just unzip the lib+include.zip file in the same folder and the opencv_world410.7z in /x64/Debug, then it should work out of the box!

So I see that input.size() is 0 while it is 1 in the working ONNX model. I have no idea why it is this way or how to fix it, I had 0 issues when converting the model from PyTorch to ONNX.

EDIT: I see that it probably is the Mul layer what is giving this error, this is the pointer to it: [ptr] = 0x0000013193b11330 {func={power=1.00000000 scale=2.803e-45#DEN shift=0.000000000 } run_parallel=false }

I don't know how this connects to the error though...

edit retag flag offensive close merge delete