首页 > 学院 > 开发设计 > 正文

训练LCNN

2019-11-08 01:27:17
字体:
来源:转载
供稿:网友
图像准备 CASIA-WebFace,有10575个人的493456张照片。 输入图片为144*144的黑白图片,随机裁剪成128*128的大小。144x144: 眼镜到嘴巴48pixel, 眼睛距离顶部48pixeltest: 128x128, 眼镜到嘴巴48pixel, 眼睛距离顶部40pixel训练参数 参考:blog1,blog2

对学习率的设置 : 初始学习率设置为0.01,训练过程中,发现初始loss为9.3,约为-log(1/10575)正常,稍加训练后,loss上升到80+,说明学习率设置过大,调整为0.001,并以inv方式进行衰减。发现loss逐渐衰减了。

全连接层Dropout设置为0.7。不同层SGD的参数也不一样,前面除了fc2层,momentum设为0.9,weight decay为5e-4,fc2层为了防止过拟合,weight decay为5e-3。learning rate从1e-3降到5e-5。最终在GTX980上训练了两周。

测试:用lfw的pair.txt测试 迭代次数115万: 96% 迭代次数240万:98%

如何用snapshot继续训练

Firstly, you need to generate snapshots. This can be done by specifing in solver.PRototxt file.

snapshot: 500snapshot_prefix: "snapshot/"

This means that it will take a snapshot every 500 iterations. And you will see snapshots in the your defined folder snapshot_prefix :

_iter_500.solverstate _iter_500.caffemodel _iter_1000.solverstate _iter_1000.caffemodel ...

Once you have the snapshot, you can specify to use the snapshot in the training script.

$caffe train -solver="xxx.prototxt" –snapshot=cifar10_quick_iter_3000.solvers

This will start the training at the 3000th iteration


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表