我在用Caffe在已知图像数据库上训练 AlexNet。我正在进行基准测试并希望排除测试阶段。
这里是solver.prototxt
对于亚历克斯网络:
net: "models/bvlc_alexnet/train_val.prototxt"
test_iter: 1000
test_interval: 1000
base_lr: 0.01
lr_policy: "step"
gamma: 0.1
stepsize: 100000
display: 20
max_iter: 450000
momentum: 0.9
weight_decay: 0.0005
snapshot: 10000
snapshot_prefix: "models/bvlc_alexnet/caffe_alexnet_train"
solver_mode: GPU
虽然我从未找到详细说明所有 prototxt 选项的明确文档,但 Caffe 教程中的评论表明了这一点“test_interval
“表示我们测试训练后的网络后的迭代次数。
我想我可以将其设置为零以关闭测试。没有。
F1124 14:42:54.691428 18772 solver.cpp:140] Check failed: param_.test_interval() > 0 (0 vs. 0)
*** Check failure stack trace: ***
所以我设置了test_interval
到一百万,但当然,Caffe 在零迭代时测试网络。
I1124 14:59:12.787899 18905 solver.cpp:340] Iteration 0, Testing net (#0)
I1124 14:59:15.698724 18905 solver.cpp:408] Test net output #0: accuracy = 0.003
如何在训练时关闭测试?
Caffe 的文档在细节上有些缺乏。最后我被告知的是这个违反直觉的解决方案:
在你的solver.prototxt中,取以下行:test_iter
and test_interval
test_iter: 1000
test_interval: 1000
并简单地忽略它们。如果您想在开始时阻止测试,您可以添加一行:@shai建议:
test_initialization: false
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)