我试图在我自己的数据上训练一个LeNet(37个由1024个类别组成的37个灰度图像)。
我创建了lmdb文件,并将输出图层的大小更改为1024.当我使用我的解算器文件运行caffe train
时,程序在打印后卡住了
...
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "score"
bottom: "label"
top: "loss"
}
I0713 17:11:13.334890 9595 layer_factory.hpp:77] Creating layer data
I0713 17:11:13.334939 9595 net.cpp:91] Creating Layer data
I0713 17:11:13.334950 9595 net.cpp:399] data -> data
I0713 17:11:13.334961 9595 net.cpp:399] data -> label
可能是什么问题?
我是caffe的新人,任何帮助都会受到赞赏。
solver.prototxt
net: "lenet_auto_train.prototxt"
test_iter: 100
test_interval: 500
base_lr: 0.01
momentum: 0.9
weight_decay: 0.0005
lr_policy: "inv"
gamma: 0.0001
power: 0.75
display: 100
max_iter: 10000
snapshot: 5000
snapshot_prefix: "lenet"
lenet.prototxt
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
transform_param {
scale: 0.00392156862745
}
data_param {
source: "dir/dat/1024_37*37_gray_lmdb"
batch_size: 64
backend: LMDB
}
}
layer {
name: "conv1"
type: "Convolution"
bottom: "data"
top: "conv1"
convolution_param {
num_output: 20
kernel_size: 5
weight_filler {
type: "xavier"
}
}
}
layer {
name: "pool1"
type: "Pooling"
bottom: "conv1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layer {
name: "conv2"
type: "Convolution"
bottom: "pool1"
top: "conv2"
convolution_param {
num_output: 50
kernel_size: 5
weight_filler {
type: "xavier"
}
}
}
layer {
name: "pool2"
type: "Pooling"
bottom: "conv2"
top: "pool2"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layer {
name: "fc1"
type: "InnerProduct"
bottom: "pool2"
top: "fc1"
inner_product_param {
num_output: 500
weight_filler {
type: "xavier"
}
}
}
layer {
name: "relu1"
type: "ReLU"
bottom: "fc1"
top: "fc1"
}
layer {
name: "score"
type: "InnerProduct"
bottom: "fc1"
top: "score"
inner_product_param {
num_output: 1024
weight_filler {
type: "xavier"
}
}
}
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "score"
bottom: "label"
top: "loss"
}
答案 0 :(得分:2)
在我的情况下,当相同的LMDB用于训练和测试时,就会发生这种情况。
答案 1 :(得分:1)
似乎caffe试图读取lmdb然后遇到问题
我的猜测是您的数据库名称"dir/dat/1024_37*37_gray_lmdb"
导致了问题:文件名中包含"*"
字符不是一个好习惯。
将数据库名称更改为"dir/dat/1024_37x37_gray_lmdb"
,然后重试(不要忘记更改原型文本)
答案 2 :(得分:1)
问题是,我将选项test_iter: 100
和test_interval: 500
放在求解器文件中,但我没有在网络文件中指定测试网络或测试数据层。