Re: regression using caffe, HDF5 format data , transform_param not defined

156 views
Skip to first unread message
Message has been deleted
Message has been deleted

anurika

unread,
Jun 3, 2016, 2:00:49 PM6/3/16
to Caffe Users
hi,
I am using AlexNet model to do regression. I created data using HDF5 format as given on other links.
Now I want to give 10 crops per image along with ImageNet mean file. When we use lmdb format we have the transform_param option to give in train_val.prototxt:
 name: "AlexNet"
layer {
  name: "data"
  type: "Data"
  top: "data"
  top: "label"
  include {
    phase: TRAIN
  }
  transform_param {
    mirror: true
    crop_size: 227
    mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
  }
  data_param {
    source: "examples/imagenet/ilsvrc12_train_lmdb"
    batch_size: 256
    backend: LMDB
  }
}

However, this option is not defined in HDF5 format. I get the following error while using transform_param in HDF5 layer.
 Check failed: !this->layer_param_.has_transform_param() HDF5Data does not transform data.
*** Check failure stack trace: ***
    @     0x7faf93693daa  (unknown)
    @     0x7faf93693ce4  (unknown)
    @     0x7faf936936e6  (unknown)
    @     0x7faf93696687  (unknown)
    @     0x7faf93da5680  caffe::HDF5DataLayer<>::LayerSetUp()
    @     0x7faf93ceae1c  caffe::Net<>::Init()
    @     0x7faf93cebca5  caffe::Net<>::Net()
    @     0x7faf93cf974a  caffe::Solver<>::InitTrainNet()
    @     0x7faf93cfa84c  caffe::Solver<>::Init()
    @     0x7faf93cfab7a  caffe::Solver<>::Solver()
    @     0x7faf93d0e633  caffe::Creator_SGDSolver<>()
    @           0x40e98e  caffe::SolverRegistry<>::CreateSolver()
    @           0x407b32  train()
    @           0x4059bc  main
    @     0x7faf929a1ec5  (unknown)
    @           0x4060f1  (unknown

I understand that transform_param is not defined in this layer. Is there any other way to do this?
Also if I dont use crop and remove the transform_param option. I get the following error:

F0603 23:29:37.623914 31763 net.cpp:765] Cannot copy param 0 weights from layer 'fc6'; shape mismatch.  Source param shape is 1 1 4096 9216 (37748736); target param shape is 4096 12544 (51380224). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.
*** Check failure stack trace: ***
    @     0x7f47166a5daa  (unknown)
    @     0x7f47166a5ce4  (unknown)
    @     0x7f47166a56e6  (unknown)
    @     0x7f47166a8687  (unknown)
    @     0x7f4716cf0797  caffe::Net<>::CopyTrainedLayersFrom()
    @     0x7f4716cf8d32  caffe::Net<>::CopyTrainedLayersFromBinaryProto()
    @     0x7f4716cf8d96  caffe::Net<>::CopyTrainedLayersFrom()
    @           0x407805  CopyLayers()
    @           0x407f95  train()
    @           0x4059bc  main
    @     0x7f47159b3ec5  (unknown)
    @           0x4060f1  (unknown)
    @              (nil)  (unknown)
Aborted (core dumped)

 I have used the standard imageNet model. My dataset contains images of size 227x227. Any help would be great.
 
Reply all
Reply to author
Forward
0 new messages