个人认为需要改以下两个地方:训练文件中增加测试层
在solver.prototxt中设定迭代多少次进行测试
train_val.prototxt
###### test layer, ignore_label
layer {name: "accuracy"
type: "Accuracy"
bottom: "score"
bottom: "label"
top: "accuracy"
accuracy_param{ ignore_label: 255 }
include {
phase: TEST
}
}
solver.prototxt
#################
net: "/home/Haichang_Li/study/caffe/models/lhc/train_val.prototxt"
##### we have test batch size 1, and 1449 test iterations.
test_iter: 1449
##### carry out testing every 50 training iterations.
test_interval: 50
display: 10
average_loss: 10
lr_policy: "fixed"
# lr for unnormalized softmax -- see train_val definition
base_lr: 1e-4
# high momentum
momentum: 0.99
# no gradient accumulation
iter_size: 1
max_iter: 300000
weight_decay: 0.0005
snapshot: 10000
snapshot_prefix: "/home/Haichang_Li/study/caffe/models/lhc/train"
Caffe训练配置优化
本文介绍如何在Caffe中优化训练配置,通过在训练文件中增加测试层,并在solver.prototxt文件中设置每50次迭代进行一次测试,以提高模型评估的效率。
3221

被折叠的 条评论
为什么被折叠?



