问题描述
尝试在我自己的数据集上训练LeNet.我从长的一维矢量数据集中生成了HDF5文件,并按如下所示创建了HDF5数据层:我对顶部Blob的命名与生成HDF5时的命名相同.
Trying to train LeNet on my own dataset. I generated HDF5 file from my long 1D vectordata set and created HDF5 data layer as follows: I named the top blobs same as I did when I generate my HDF5.
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"
}
}
}
layer {
name: "pool1"
type: "pooling"
bottom: "conv1"
top: "pool1"
pooling_param{
pool: MAX
kernel_h: 1
kernel_w: 2
stride_h: 1
stride_w: 2
}
}
# more layers here...
layer{
name: "loss"
type: "SigmoidCrossEntropyLoss"
bottom: "ip2"
bottom: "label"
top: "loss"
}
但是当我尝试训练时,却出现了来自insert_split.cpp
的以下错误.
But then when I tried to train I am having the following error from insert_split.cpp
.
insert_splits.cpp:29] Unknown bottom blob 'data' (layer 'conv1', bottom index 0)
*** Check failure stack trace: ***
@ 0x7f19d7e735cd google::LogMessage::Fail()
@ 0x7f19d7e75433 google::LogMessage::SendToLog()
@ 0x7f19d7e7315b google::LogMessage::Flush()
@ 0x7f19d7e75e1e google::LogMessageFatal::~LogMessageFatal()
@ 0x7f19d82684dc caffe::InsertSplits()
@ 0x7f19d8230d5e caffe::Net<>::Init()
@ 0x7f19d8233f21 caffe::Net<>::Net()
@ 0x7f19d829c68a caffe::Solver<>::InitTrainNet()
@ 0x7f19d829d9f7 caffe::Solver<>::Init()
@ 0x7f19d829dd9a caffe::Solver<>::Solver()
@ 0x7f19d8211683 caffe::Creator_SGDSolver<>()
@ 0x40a6c9 train()
@ 0x4071c0 main
@ 0x7f19d6dc8830 __libc_start_main
@ 0x4079e9 _start
@ (nil) (unknown)
Aborted (core dumped)
我做错了什么?
干杯
推荐答案
您的数据层输出两个斑点":"label"
和 "Inputdata"
.您的"conv1"
层需要一个名为 "data"
的"blob"作为输入. Caffe不知道您的意思是"Inputdata"
和"data"
是相同的blob ...
现在,由于您已经用"Inputdata"
名称保存了hdf5文件,因此您无法在"HDF5Data"
层中更改此名称,您可以在"conv1"
层的底部"将"data"
更改为"Inputdata"
.
Your data layer outputs two "blobs": "label"
and "Inputdata"
. Your "conv1"
layer expects as input a "blob" named "data"
. Caffe does not know that you meant "Inputdata"
and "data"
to be the same blob...
Now, since you already saved the hdf5 files with "Inputdata"
name, you cannot change this name in the "HDF5Data"
layer, what you can do is change "data"
to "Inputdata"
in the "bottom" of "conv1"
layer.
PS,
您的损失层需要两个底端":您忘记喂食的ip2
和label
.
PS,
Your loss layer requires two "bottom"s: ip2
and label
you forgot to feed.
这篇关于未知的底部Blob“数据"(图层"conv1",底部索引0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!