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?
if this is the 1st layer, you could try to replace it with:
does it really have 64 "channels" there ?
As you can see in the prototxt file, it's not the first layer (however it is the first dummylayer). You mean to replace it like this?
no, it was meant literally, and since it's NOT the 1st data layer, it probably can't apply
(yea, sorry did not see your prototxt)
btw, why did you convert it to caffe ? (did you retrain it ?) does the original tf model work with opencv ?
I'm trying to develop an object detection counting algorithm, specifically this implementation by Adrian Rosebrock. This implementation requires a caffe model instead of a TF model.
well adrian's tutorial seems to mainly highlight his "centroid tracker"
we do have ready-made SSD detection caffe models in the zoo. i'm also quite sure, that you can use others like yolo or squeezedet, with a bit of hacking...
That's true, but I'm trying to implement my own model which is trained in Tensorflow. It's a faster RCNN inception resnet v2 model.
ok,ok, and nice, that you trained your own !
good to know, maybe we can find out, what the DummyLayer is about now
I'll make sure to get back to you if I find a solution. Hopefully someone here knows something ;)