以下是我的微调模型的输入层:
layer {
type: "HDF5Data"
name: "data"
top: "Meta"
hdf5_data_param {
source: "/path/to/train.txt"
batch_size: 50
}
include { phase: TRAIN }
}
layer {
name: "data"
type: "ImageData"
top: "X"
top: "Labels"
include {
phase: TRAIN
}
transform_param {
mirror: true
crop_size: 227
mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
}
image_data_param {
source: "/path/to/train.txt"
batch_size: 50
new_height: 256
new_width: 256
}
}
layer {
type: "HDF5Data"
name: "data"
top: "Meta"
hdf5_data_param {
source: "/path/to/val.txt"
batch_size: 50
}
include { phase: TEST }
}
layer {
name: "data"
type: "ImageData"
top: "X"
top: "Labels"
include {
phase: TEST
}
transform_param {
mirror: false
crop_size: 227
mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
}
image_data_param {
source: "/path/to/val.txt"
batch_size: 50
new_height: 256
new_width: 256
}
}
如您所见,它有一个 imagedata 输入层和 1 个 hdf5 输入层,如果只有一种类型的层,比如 imagedata,我可以这样做:
input_data = {prepare_images(im)}; # dimension 227*227*3*10
然后
scores = caffe('forward',input_data);
但是在这里我必须给出两种类型的输入数据,我该怎么做呢?请帮忙!