我们需要帮助来理解用于较小训练集 (6000 jpgs) 和 val (170 jpgs) jpgs 的参数。我们的执行在迭代 0 中的测试分数 0/1 后被杀死并退出。
我们正在尝试在 caffe 网站教程上运行 imagenet 示例
http://caffe.berkeleyvision.org/gathered/examples/imagenet.html.
我们没有使用包中的全套 ILSVRC2 图像,而是使用我们自己的 6000 个 jpeg 训练集和 170 个 jpeg 图像的 val 集。按照说明,它们是 train 和 val 目录中的每个 256 x 256 jpeg 文件。我们运行脚本来获取辅助数据:
./data/ilsvrc12/get_ilsvrc_aux.sh
train.txt 和 val.txt 文件设置为描述每个 jpeg 文件的两个可能类别之一。然后我们运行脚本来计算似乎运行正确的平均图像数据:
./examples/imagenet/make_imagenet_mean.sh
我们将教程中提供的模型定义用于 imagenet_train.prototxt 和 imagenet_val.prototxt。由于我们训练的图像要少得多,我们修改了 imagenet_solver.prototxt 如下:
train_net: "./imagenet_train.prototxt"
test_net: "./imagenet_val.prototxt"
test_iter: 3
test_interval: 10
base_lr: 0.01
lr_policy: "step"
gamma: 0.1
stepsize: 10
display: 20
max_iter: 45
momentum: 0.9
weight_decay: 0.0005
snapshot: 10
snapshot_prefix: "caffe_imagenet_train"
solver_mode: CPU
当我们使用以下命令运行它时:
./train_imagenet.sh
我们在它挂起的地方得到以下输出:
.......
.......
I0520 23:07:53.175761 4678 net.cpp:85] drop7 <- fc7
I0520 23:07:53.175791 4678 net.cpp:99] drop7 -> fc7 (in-place)
I0520 23:07:53.176246 4678 net.cpp:126] Top shape: 50 4096 1 1 (204800)
I0520 23:07:53.176275 4678 net.cpp:152] drop7 needs backward computation.
I0520 23:07:53.176296 4678 net.cpp:75] Creating Layer fc8
I0520 23:07:53.176306 4678 net.cpp:85] fc8 <- fc7
I0520 23:07:53.176314 4678 net.cpp:111] fc8 -> fc8
I0520 23:07:53.184213 4678 net.cpp:126] Top shape: 50 1000 1 1 (50000)
I0520 23:07:53.184908 4678 net.cpp:152] fc8 needs backward computation.
I0520 23:07:53.185607 4678 net.cpp:75] Creating Layer prob
I0520 23:07:53.186135 4678 net.cpp:85] prob <- fc8
I0520 23:07:53.186538 4678 net.cpp:111] prob -> prob
I0520 23:07:53.187166 4678 net.cpp:126] Top shape: 50 1000 1 1 (50000)
I0520 23:07:53.187696 4678 net.cpp:152] prob needs backward computation.
I0520 23:07:53.188244 4678 net.cpp:75] Creating Layer accuracy
I0520 23:07:53.188431 4678 net.cpp:85] accuracy <- prob
I0520 23:07:53.188540 4678 net.cpp:85] accuracy <- label
I0520 23:07:53.188870 4678 net.cpp:111] accuracy -> accuracy
I0520 23:07:53.188907 4678 net.cpp:126] Top shape: 1 2 1 1 (2)
I0520 23:07:53.188915 4678 net.cpp:152] accuracy needs backward computation.
I0520 23:07:53.188922 4678 net.cpp:163] This network produces output accuracy
I0520 23:07:53.188942 4678 net.cpp:181] Collecting Learning Rate and Weight Decay.
I0520 23:07:53.188954 4678 net.cpp:174] Network initialization done.
I0520 23:07:53.188961 4678 net.cpp:175] Memory required for Data 210114408
I0520 23:07:53.189008 4678 solver.cpp:49] Solver scaffolding done.
I0520 23:07:53.189018 4678 solver.cpp:61] Solving CaffeNet
I0520 23:07:53.189033 4678 solver.cpp:106] Iteration 0, Testing net
I0520 23:09:06.699695 4678 solver.cpp:142] Test score #0: 0
I0520 23:09:06.700203 4678 solver.cpp:142] Test score #1: 7.07406
Killed
Done.