net.forward() error: (-215:Assertion failed) inp.total() in function 'allocateLayers'

asked 2020-06-24 04:58:59 -0600

goncz gravatar image

updated 2020-06-24 05:48:36 -0600

I'm trying to run my Caffe object detection model in a counting/tracking application. I've converted a self trained tensorflow model to a caffemodel using MMdnn conversion (prototxt file). However, when i run my script, i get the follwing error:

Traceback (most recent call last):
  File "people_counter.py", line 132, in <module>
    detections = net.forward()
cv2.error: OpenCV(4.2.0) /io/opencv/modules/dnn/src/dnn.cpp:2709: error: (-215:Assertion failed) inp.total() in function 'allocateLayers'

This issue arised after I changed the type of a DummyLayer in the prototxt to "Input" like this:

layer {
  name: "DummyData1"
  type: "Input"
  top: "DummyData1"
  dummy_data_param {
    shape {
      dim: 1
      dim: 64
      dim: 150
      dim: 150
    }
  }
}

Any suggestions on how to fix this issue?

edit retag flag offensive close merge delete

Comments

Some duplicated allocateLayers

supra56 gravatar imagesupra56 ( 2020-06-24 06:45:31 -0600 )edit

This is not the same issue as the one you pointed out, as this is related to the net.forward() function whereas the one you referenced is related to the cv2.dnn.readNetFromCaffe() function.

goncz gravatar imagegoncz ( 2020-06-24 06:49:52 -0600 )edit