首页 > 其他 > 详细

caffe在solverstate的基础上继续训练模型

时间:2017-11-07 11:47:57      阅读:512      评论:0      收藏:0      [点我收藏+]

以mnist数据集为例:

bat训练脚本:

Build\x64\Release\caffe.exe train --solver=examples/mnist/lenet_solver.prototxt 
pause 

  技术分享

在这个模型的基础上,继续训练。

继续训练之前,也可以修改lenet_solver.prototxt中的学习率。

Build\x64\Release\caffe.exe train --solver=examples/mnist/lenet_solver.prototxt --snapshot=examples/mnist/lenet_iter_1000.solverstate
pause 

 训练从1000次iterations开始。技术分享

 

用Python脚本启动训练:

import caffe

caffe.set_device(int(0))
caffe.set_mode_gpu()

solver = caffe.SGDSolver(.\\examples\\mnist\\lenet_solver.prototxt)
solver.solve()

加载已训练的模型,只用加一句话

import caffe

caffe.set_device(int(0))
caffe.set_mode_gpu()

solver = caffe.SGDSolver(.\\examples\\mnist\\lenet_solver.prototxt)
solver.restore(‘examples\\mnist\\lenet_iter_5000.solverstate‘)
solver.solve()

 

caffe在solverstate的基础上继续训练模型

原文:http://www.cnblogs.com/k7k8k91/p/7798278.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!