1

What are the differences between the Deconvolution layer in Caffe and Tensorflow? In Tensoroflow, there are two padding modes: "SAME" and "VALID", which one is equal to padding mode that was used in Caffe?

For example, in Tensorflow, the Deconvolution layer is:

decv = slim.convolution2d_transpose(in_layer, num_outputs=256, kernel_size=[8, 8], stride=4, padding='VALID', scope='decv')

And in Caffe, it is:

layer { 
  name: "decv"
  type: "Deconvolution"
  bottom: "some_layer"
  top: "some_layer"
  param { lr_mult: 1 decay_mult: 1.0 }
  param { lr_mult: 2 decay_mult: 0}
  convolution_param {
    num_output: 256
    pad: 1 stride: 4 kernel_size: 8
    group: 256 
    weight_filler { type: "bilinear" }
  }
}

I can not achieve the same upsampling map when transfer the code from Caffe to Tensorflow.

trminh89
  • 877
  • 2
  • 10
  • 17

1 Answers1

0

'VALID' means no padding, but your Caffe layer is padded with pad: 1.

Try 'SAME' padding

kafaso
  • 67
  • 6