Unknown bottom blob 'data' (layer 'conv1', bottom index 0)

来源:互联网 发布:金凯度 知乎 编辑:程序博客网 时间:2024/05/16 02:52


caffe训练的时候,出现错误Unknown bottom blob 'data' (layer 'conv1', bottom index 0)


原因1: 

data layer中的top名称与conv1 bottom的名称不一致。

比如:(下方红色字内容应该统一,否则报错)

name: "Test_net"layer {  name: "data"  type: "HDF5Data"  top: "Inputdata"  top: "label"  hdf5_data_param {    source:"~/*_hdf5_train.txt"    batch_size: 32  }  include{phase: TRAIN}}layer {  name: "data2"  type: "HDF5Data"  top: "Inputdata"  top: "label"  hdf5_data_param {    source:"~/*_hdf5_test.txt"    batch_size: 32  }  include{phase: TEST}}layer {  name: "conv1"  type: "convolution"  bottom: "data"  top: "conv1"  param {lr_mult:1}  param {lr_mult:2}  convolution_param{    num_output: 20    kernel_h: 1    kernel_w: 5    stride_h: 1    stride_w: 1    weight_filler {      type: "xavier"         }    bias_filler {      type: "xavier"    }  }}


原因2:

没有单独的测试数据,在网络中却使用了phrase:TRAIN 或TEST的定义。

比如:(不该有下方红色字的部分,否则报错)

name: "Test_net"layer {  name: "data"  type: "HDF5Data"  top: "data"  top: "label"  hdf5_data_param {    source:"~/*_hdf5_train.txt"    batch_size: 32  }  include{phase: TRAIN}}layer {  name: "conv1"  type: "convolution"  bottom: "data"  top: "conv1"  param {lr_mult:1}  param {lr_mult:2}  convolution_param{    num_output: 20    kernel_h: 1    kernel_w: 5    stride_h: 1    stride_w: 1    weight_filler {      type: "xavier"         }    bias_filler {      type: "xavier"    }  }}


原创粉丝点击