打印数据后 Caffe 挂起 -> 标签
Caffe hangs after printing data -> label
我正在尝试根据自己的数据(1024 个类别的 37 x 37 灰度图像)训练 LeNet。
我创建了 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
可能是什么问题?
我是咖啡新手,任何帮助将不胜感激。
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"
}
好像是caffe试图读取lmdb然后遇到了问题。
我的猜测是您的数据库名称 "dir/dat/1024_37*37_gray_lmdb"
导致了问题:在文件名中包含 "*"
字符不是一个好的做法。
将数据库名称更改为 "dir/dat/1024_37x37_gray_lmdb"
之类的名称,然后重试(不要忘记也更改 prototxt)
问题是,我把选项test_iter: 100
和test_interval: 500
放在求解器文件中,但我没有在网络文件中指定测试网络或测试数据层。
在我的例子中,当同一个 LMDB 用于训练和测试时,就会发生这种情况。
我正在尝试根据自己的数据(1024 个类别的 37 x 37 灰度图像)训练 LeNet。
我创建了 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
可能是什么问题?
我是咖啡新手,任何帮助将不胜感激。
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"
}
好像是caffe试图读取lmdb然后遇到了问题。
我的猜测是您的数据库名称 "dir/dat/1024_37*37_gray_lmdb"
导致了问题:在文件名中包含 "*"
字符不是一个好的做法。
将数据库名称更改为 "dir/dat/1024_37x37_gray_lmdb"
之类的名称,然后重试(不要忘记也更改 prototxt)
问题是,我把选项test_iter: 100
和test_interval: 500
放在求解器文件中,但我没有在网络文件中指定测试网络或测试数据层。
在我的例子中,当同一个 LMDB 用于训练和测试时,就会发生这种情况。