Search code examples
caffedummy-dataopencv-contrib

Can't load Caffe model with DummyData layer


when I try to load a caffe model with OpenCV 3.4.3, I get the error

what(): OpenCV(3.4.3) /home/schneider/libs/opencv-3.4.3/modules/dnn/src/dnn.cpp:412: error: (-2:Unspecified error) Can't create layer "DummyData1" of type "DummyData" in function 'getLayerInstance'*

The layer in the prototxt file looks like this:

layer {
name: "DummyData1"
type: "DummyData"
top: "DummyData1"
dummy_data_param {
    shape {
    dim: 1
    dim: 32
    dim: 125
    dim: 100
          }
   }
} 

It appears that the layer is missing in OpenCV. The caffe layer is described here on the Caffe webpage, but I am not sure how to implement this layer in OpenCV. Has it already been implemented somewhere? How can I solve this problem?


Solution

  • if you able to change a .protptxxt the file you can replace these line to the following ones. Try this gys

    layer {
        type: "Input"
        name: "DummyData1"
        top: "DummyData1"
        input_param {
         shape {
         dim: 1
         dim: 32
         dim: 125
         dim: 100
              }
            }
         }
    

    or

    input: "DummyData1"
    input_dim: 1
    input_dim: 32
    input_dim: 125
    input_dim: 100