Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

DNN from Caffe deconvolution layer assert fails

Hi,

I have a model which works fine in Caffe, but in OpenCV 3.3.0 it triggers an assert.

It fails because there is a convolution with 128 outputs followed by a ReLU and then a deconvolution with 64 outputs. OpenCV seems to have an assert stating that the number of outputs must match, however in Caffe this appears to be working fine.

So I was wondering if anyone else has come up against this issue and how they had got around it. Also, whether anyone knows why this isn't allowed in OpenCV?

Thanks for and insight!

Carl

DNN from Caffe deconvolution layer assert fails

Hi,

I have a model which works fine in Caffe, but in OpenCV 3.3.0 it triggers an assert.

It fails because there is a convolution with 128 outputs followed by a ReLU and then a deconvolution with 64 outputs. OpenCV seems to have an assert stating that the number of outputs must match, however in Caffe this appears to be working fine.

So I was wondering if anyone else has come up against this issue and how they had got around it. Also, whether anyone knows why this isn't allowed in OpenCV?

Thanks for and insight!

Carl

Edit:

input: "images"
 input_shape {
   dim: 1
   dim: 3
   dim: 154
   dim: 100
 }
layer {
  name: "conv_d0a-b"
  type: "Convolution"
  bottom: "images"
  top: "d0b"
  convolution_param {
    num_output: 128
    kernel_size: 5
  }
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
}
layer {
  name: "relu_d0b"
  type: "ReLU"
  bottom: "d0b"
  top: "d0b"
}
layer {
  name: "upconv_u1d_u0a"
  type: "Deconvolution"
  bottom: "d0b"
  top: "d0b"
  convolution_param {
    num_output: 64
    kernel_size: 2
    stride: 2
  }
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
}