disable dilated deconvolution
authorFisher Yu <i@yf.io>
Sat, 26 Dec 2015 21:10:02 +0000 (13:10 -0800)
committerJonathan L Long <jonlong@cs.berkeley.edu>
Mon, 28 Dec 2015 23:07:40 +0000 (15:07 -0800)
src/caffe/layers/base_conv_layer.cpp

index 4a4c68e..deb58a7 100644 (file)
@@ -105,6 +105,9 @@ void BaseConvolutionLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
   for (int i = 0; i < num_spatial_axes_; ++i) {
     dilation_data[i] = (num_dilation_dims == 0) ? kDefaultDilation :
                        conv_param.dilation((num_dilation_dims == 1) ? 0 : i);
+    if (reverse_dimensions()) {
+      CHECK_EQ(dilation_data[i], 1) << "Deconvolution doesn't support dilation";
+    }
   }
   // Special case: im2col is the identity for 1x1 convolution with stride 1
   // and no padding, so flag for skipping the buffer and transformation.