Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can't create layer "DummyData1" of type "DummyData" in function 'getLayerInstance'

I converted a tensorflow model to a caffe model (tf_resnet.prototxt), and I'm now trying to run an object detection counting algorithm (code). However, i get the following error:

[INFO] loading model...
[INFO] opening video file...
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:562: error: (-2:Unspecified error) Can't create layer "DummyData1" of type "DummyData" in function 'getLayerInstance'

This similar issue on Stackoverflow suggested to change the type: "DummyData1" to type: "Input" in the following code:

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

However, when doing this, i get another 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'

Any suggestions on how to fix this?