Caffe模型Interfaces的命令行使用的注意事项

Caffe的Interfaces注意事项

最近在看CaffeCN社区翻译的《Caffe官方教程中译本》这本资料,看到Interface部分,这块的主要内容是用命令行接口的方式训练、测试模型或者计算得分。

# 训练 LeNet
caffe train -solver examples/mnist/lenet_solver.prototxt
# 在 2 号 GPU 上训练
caffe train -solver examples/mnist/lenet_solver.prototxt -gpu 2
# 从中断点的 snapshot 继续训练
caffe train -solver examples/mnist/lenet_solver.prototxt -snapshot
examples/mnist/lenet_iter_5000.solverstate

直接按照给的命令敲发现无法运行,百度了一下找到了解决方法,正确的方式:

# 训练 LeNet
./build/tools/caffe train -solver examples/mnist/lenet_solver.prototxt
# 在 2 号 GPU 上训练
./build/tools/caffetrain -solver examples/mnist/lenet_solver.prototxt -gpu 2
# 从中断点的 snapshot 继续训练
./build/tools/caffe train -solver examples/mnist/lenet_solver.prototxt -snapshot
examples/mnist/lenet_iter_5000.solverstate

就是把命令中的caffe换成./build/tools/caffe
之所以要这么做的原因:caffe的c++主程序(caffe.cpp)放在./build/tools/ 文件夹内。因此我们要执行caffe程序,都需要加 ./build/tools/ 前缀。

猜你喜欢

转载自blog.csdn.net/xw2017/article/details/78936437