-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
eltwise_layer.cpp:209: error: (-215:Assertion failed) inputs[0][j] == inputs[i][j] in function 'getMemoryShapes' #17058
Description
System information (version)
- OpenCV => 4.2.0.34 (opencv-python)
- Operating System / Platform => Ubuntu 18.04
- Compiler => Python3.7
Detailed description
Hi I am having the following issue.
I trained 'ssd mobilenet-v3' and got 'frozen_inference_graph.pb' and 'graph.pbtxt' with reference to 'https://github.com/opencv/opencv/wiki/TensorFlow-Object-Detection-API'
I read 'graph' using 'cv2.dnn.readNetFromTensorflow' module
and put blob image
'net.forward()' I got this error
[ERROR:0] global /io/opencv/modules/dnn/src/dnn.cpp (3066) getLayerShapesRecursively OPENCV/DNN: [Eltwise]:(FeatureExtractor/MobilenetV3/expanded_conv_3/squeeze_excite/mul): getMemoryShapes() throws exception. inputs=2 outputs=0/1
[ERROR:0] global /io/opencv/modules/dnn/src/dnn.cpp (3069) getLayerShapesRecursively input[0] = [ 1 72 40 40 ]
[ERROR:0] global /io/opencv/modules/dnn/src/dnn.cpp (3069) getLayerShapesRecursively input[1] = [ 1 72 1 1 ]
cv2.error: OpenCV(4.2.0) /io/opencv/modules/dnn/src/layers/eltwise_layer.cpp:209: error: (-215:Assertion failed) inputs[0][j] == inputs[i][j] in function 'getMemoryShapes'
this is sample code
MODEL = MODEL_PATH + '/frozen_inference_graph.pb'
CONFIG = MODEL_PATH + '/graph.pbtxt'cvNet = cv2.dnn.readNetFromTensorflow(MODEL, CONFIG)
cvNet.setInput(cv2.dnn.blobFromImage(frame, size=(320, 320), swapRB=True, crop=False))
cvOut = cvNet.forward()
I found a similar issue and your advice.
Is this the only way? Or is there another way? If there is another way, please advise me. Thank you
Issue submission checklist
-
I report the issue, it's not a question
-
I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution -
I updated to latest OpenCV version and the issue is still there
-
There is reproducer code and related data files: videos, images, onnx, etc