Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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

1 model loads successfully, but this particular one also gives issues in other ways, like with converting the ONNX model to Tensorflow I get this:

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("Mul_3:0", shape=(), dtype=int64)'

But I'm not sure if this has anything to do with it, also have no idea if the error is due to how I setup the model inside PyTorch or if it's in OpenCV (but the model loads and does inference fine in PyTorch itself)

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

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!

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

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

1 model loads successfully, but this particular one also gives issues in other ways, like with converting the ONNX model to Tensorflow I get this:

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("Mul_3:0", shape=(), dtype=int64)'

But I'm not sure if this has anything to do with it, also have no idea if the error is due to how I setup the model inside PyTorch or if it's in OpenCV (but the model loads and does inference fine in PyTorch itself)

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

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.

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

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

1 model loads successfully, but this particular one also gives issues in other ways, like with converting the ONNX model to Tensorflow I get this:

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("Mul_3:0", shape=(), dtype=int64)'

But I'm not sure if this has anything to do with it, also have no idea if the error is due to how I setup the model inside PyTorch or if it's in OpenCV (but the model loads and does inference fine in PyTorch itself)

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

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.

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

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

1 model loads successfully, but this particular one also gives issues in other ways, like with converting the ONNX model to Tensorflow I get this:

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("Mul_3:0", shape=(), dtype=int64)'

But I'm not sure if this has anything to do with it, also have no idea if the error is due to how I setup the model inside PyTorch or if it's in OpenCV (but the model loads and does inference fine in PyTorch itself)

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

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.

Right now I'm guessing that OpenCV just doesn't supports a certain layer/datatype yet that PyTorch uses, as with the other frameworks. Or is this supposed to give an other error as the input.size() error?

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

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

1 model loads successfully, but this particular one also gives issues in other ways, like with converting the ONNX model to Tensorflow I get this:

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype int64: 'Tensor("Mul_3:0", shape=(), dtype=int64)'

But I'm not sure if this has anything to do with it, also have no idea if the error is due to how I setup the model inside PyTorch or if it's in OpenCV (but the model loads and does inference fine in PyTorch itself)

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

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.

Right now I'm guessing EDIT: I see that OpenCV just doesn't supports a certain layer/datatype yet that PyTorch uses, as with it probably is the other frameworks. Or Floor layer what is giving this supposed error, this is the pointer to give it: [ptr] = 0x0000013193b11330 {func={power=1.00000000 scale=2.803e-45#DEN shift=0.000000000 } run_parallel=false }

I don't know why it has an other error as the input.size() error?input missing though..

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

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/decodererror

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 Floor 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 why it has an input missing though..how this connects to the error though...

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

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/decodererror

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 Floor 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...