I have a prototxt as follows:
layer {
name: "data"
type: "HDF5Data"
top: "data1"
top: "data2"
top: "label"
include {
phase: TRAIN
}
hdf5_data_param {
source: "./source_list.txt"
batch_size: 2
shuffle: true
}
}
layer {
name: "concat"
type: "Concat"
bottom: "data1"
bottom: "data2"
top: "data"
concat_param {
concat_dim:1
}
}
I want to generate above prototxt using caffe NetSpec in python. However, It was wrong. This is my code. Please help me to fix it. Thanks
from caffe import layers as L
...
n = caffe.NetSpec()
n.data, n.label = L.HDF5Data(top=["data1", "data2"], batch_size=2,
source="./source_list.txt", ntop=2,shuffle= True,
include={'phase': caffe.TRAIN})
n.concat = L.Concat(n.data["data1"], n.data["data2"])
You need to have two
data
outputs