BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.09k stars 18.7k forks source link

Cannot use legacy accessors on Blobs with > 4 axes (XavierFiller) in 3D data #5289

Open John1231983 opened 7 years ago

John1231983 commented 7 years ago

I am using 3D convolution in the newest caffe version. This is my convolution setting

 layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  param {  ..  }
  convolution_param {
    num_output: 32
    kernel_size: 3
    pad: 1
    stride: 1
    engine: CUDNN
   #engine: CAFFE
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}

I got the bellow error. It looks like the xavier initialization has some problem in 3D data (Note that gaussian filter is fine). Someone suggests to remove line 140,141 in blob.hpp but I do not think it is official solution. I also looked at the pull 5063, but it does not merged in current caffe (I think it did not review). How should I do to solve this issue?

F0216 11:19:02.512056 16273 blob.hpp:140] Check failed: num_axes() <= 4 (5 vs. 4) Cannot use legacy accessors on Blobs with > 4 axes.
*** Check failure stack trace: ***
    @     0x7fc49c03fdaa  (unknown)
    @     0x7fc49c03fce4  (unknown)
    @     0x7fc49c03f6e6  (unknown)
    @     0x7fc49c042687  (unknown)
    @     0x7fc49c659686  caffe::Blob<>::LegacyShape()
    @     0x7fc49c6f32b5  caffe::XavierFiller<>::Fill()
    @     0x7fc49c722f1e  caffe::BaseConvolutionLayer<>::LayerSetUp()
    @     0x7fc49c777ce4  caffe::CuDNNConvolutionLayer<>::LayerSetUp()
    @     0x7fc49c6766f4  caffe::Net<>::Init()
    @     0x7fc49c678c55  caffe::Net<>::Net()
    @     0x7fc49c681806  caffe::Solver<>::InitTrainNet()
    @     0x7fc49c682c33  caffe::Solver<>::Init()
    @     0x7fc49c682f4f  caffe::Solver<>::Solver()
    @     0x7fc49c692c61  caffe::Creator_SGDSolver<>()
    @           0x4096c0  train()
    @           0x405f08  main
    @     0x7fc49ab9df45  (unknown)
    @           0x40676c  (unknown)
    @              (nil)  (unknown)
freeubuntu commented 7 years ago

have you solved this problem?

MrBurnst commented 7 years ago

Any news on this? I managed to get the convolution and relu layers to work in 3d by setting engine to CAFFE, however that fails for pooling...

pooling_layer.cpp:81] Check failed: 4 == bottom[0]->num_axes() (4 vs. 5) Input must have 4 axes, corresponding to (num, channels, height, width)

and the source of pooling_layer.cpp doesn't really look like it would support > 2d pooling ...