问题
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