Ask Your Question

Revision history [back]

Strange error in getMemmoryShapes function

Hello everyone! Currently, I'm try to solve the object detection task. The model in used is MobileNetV1 + SSD from https://github.com/qfgaohao/pytorch-ssd/blob/master/vision/ssd/mobilenetv1_ssd.py, The code was written in PyTorch framework. In order to use this model in OpenvCV library I converted it to ONNX representation by the standard torch.onnx module. But when I'm try to read this .onnx file I get the next error: cv2.error: OpenCV(4.0.1-dev) /home/user/opencv/modules/dnn/src/layers/slice_layer.cpp:129: error: (-215:Assertion failed) inputs.size() == 1 in function 'getMemoryShapes'

I'd like to note that when I'm cnonvert only MobileNetV1 in ONNX representation and read it through the dnn.readNetFromONNX(net) I don't get the above error. All works well.

What am I doing wrong?

click to hide/show revision 2
None

updated 2019-02-25 01:46:59 -0500

berak gravatar image

Strange error in getMemmoryShapes function

Hello everyone! Currently, I'm try to solve the object detection task. The model in used is MobileNetV1 + SSD from https://github.com/qfgaohao/pytorch-ssd/blob/master/vision/ssd/mobilenetv1_ssd.py, The code was written in PyTorch framework. In order to use this model in OpenvCV library I converted it to ONNX representation by the standard torch.onnx module. But when I'm try to read this .onnx file I get the next error: cv2.error: OpenCV(4.0.1-dev) /home/user/opencv/modules/dnn/src/layers/slice_layer.cpp:129: error: (-215:Assertion failed) inputs.size() == 1 in function 'getMemoryShapes'

I'd like to note that when I'm cnonvert only MobileNetV1 in ONNX representation and read it through the dnn.readNetFromONNX(net) I don't get the above error. All works well.

What am I doing wrong?