HDF5Data Processing with Caffe's Transformer for training

有些话、适合烂在心里 提交于 2019-12-11 05:14:54

问题


I am trying to load data to the network, since I need a custom data input (3 tops: 1 for data image, 2 for different labels) I load the data with HD5F files. It looks similar to this:

layer {
  name: "data"
  type: "HDF5Data"
  top: "img"
  top: "alabels"
  top: "blabels"
  include {
    phase: TRAIN
  }
  hdf5_data_param {
    source: "path_to_caffe/examples/hdf5_classification/data/train.txt"
    batch_size: 64
  }
} 

I want to preprocess the images using Caffe's own Transformer (for standard), how can I do this when I have to initialize the Transformer with data blob of a network model:

transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape})

All the examples I have found first loads a pre-trained net and sets a transformer with its data blob/shape, but I couldn't find any for training. Thanks.

来源:https://stackoverflow.com/questions/47799416/hdf5data-processing-with-caffes-transformer-for-training

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!