我正在尝试使用自己的数据(37×37像素的灰度图像,共1024个类别)训练LeNet网络。
我创建了lmdb文件,并将输出层的尺寸改成了1024。当我使用我的solver文件运行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 dataI0713 17:11:13.334939 9595 net.cpp:91] Creating Layer dataI0713 17:11:13.334950 9595 net.cpp:399] data -> dataI0713 17:11:13.334961 9595 net.cpp:399] data -> label
可能是什么问题呢?
我刚开始使用Caffe,任何帮助都将不胜感激。
solver.prototxt
net: "lenet_auto_train.prototxt"test_iter: 100test_interval: 500base_lr: 0.01momentum: 0.9weight_decay: 0.0005lr_policy: "inv"gamma: 0.0001power: 0.75display: 100max_iter: 10000snapshot: 5000snapshot_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"}
回答:
问题在于,我在solver文件中设置了test_iter: 100
和test_interval: 500
,但我在网络文件中没有指定测试网络或测试数据层。