finetune network using imagedata and hdf5 for data layer

186 views
Skip to first unread message

Cristina Segalin

unread,
Apr 9, 2015, 7:57:15 AM4/9/15
to caffe...@googlegroups.com
Hello everyone,

I am trying to finetune my network starting from the imagenet model.
As I am trying to predict multiple labels I figured out that I need to use hdf5 format file for multiple float labels.
Can I still use IMAGE_DATA type for my data (text list of images) and hdf5 file for labels in this way?

layer {
  name: "data"
  type: "ImageData"
  top: "data"
  top: "dummy"
  include {
    phase: TRAIN
  }
  transform_param {
    mirror: true
    crop_size: 227
    mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
  }
  image_data_param {
    source: "path/train_ptE.txt"
    batch_size: 60
    new_height: 256
    new_width: 256
  }
}
layer {
  name: "labels"
  type: "HDF5Data"
  top: "label"
  include {
    phase: TRAIN
  }
  hdf5_data_param {
    source: "path/train_h5files.txt"
    batch_size: 60
  }
}

Or shall I prepare a unique hdf5 file with images and labels? Although in this way how can I deal with the copies of images mirrored flipped cropped?

Thanks

Prophecies

unread,
Apr 29, 2016, 4:54:35 PM4/29/16
to Caffe Users
Hi, I am trying to do similar thing. Only way I can think of right now is using (a somewhat improved) pycaffe interface and use memorydata layer instead of hdf5 to generate data on the fly for each epoch. But, I would also want to do a shuffle of the image data and I am not sure how I can align the two.

Did you ever figure this out? Please let me know.
Reply all
Reply to author
Forward
0 new messages