pycaffe使用(第一篇)——训练网络

来源:互联网 发布:熊掌好吃吗 知乎 编辑:程序博客网 时间:2024/06/05 09:50
“”“这篇讲述的是如何利用solver.prototxt进行训练”“”# -*- coding: UTF-8 -*-__author__ = 'xuy'import caffeimport osCaffe_root='/home/xuy/caffe'os.chdir(Caffe_root)#将当前的路径换成了~/caffe"""对于caffe的硬件进行设置:是使用cpu还是使用gpu"""USE_GPU=Trueif USE_GPU:    caffe.set_device(0)    caffe.set_mode_gpu()else:    caffe.set_mode_cpu()print 'Initialized caffe'"""开始训练"""solver_file="examples/mnist/lenet_solver.prototxt"solver=caffe.SGDSolver(solver_file)solver.solve()

阅读全文
0 0
原创粉丝点击