如何绘制caffe训练过程中的loss和accurary的曲线??

来源:互联网 发布:linux进程占用cpu过高 编辑:程序博客网 时间:2024/05/22 06:15
caffe/tools/extra/plot_training_log.py.example自带的绘图的小脚本
关于获取日志文件,我用的方法和@齐浩之 提到的一样,写个脚本,运行这个脚本开始训练,这样就可以保存日志了, 脚本如下
#!/bin/bashLOG=log/train-`date +%Y-%m-%d-%H-%M-%S`.logCAFFE=~/caffe/build/tools/caffe$CAFFE train --solver=solver.prototxt --gpu=0 2>&1 | tee $LOG

根据caffe官网的说明:
The final model, stored as a binary protobuf file, is stored at
lenet_iter_10000
which you can deploy as a trained model in your application, if you are training on a real-world application dataset.
是说训练完成后的模型,存在这个lenet_iter_10000文件里,之后就可以deploy在自己的程序里。。
可是怎么使用这个文件呢?

我也找了很久,终于找到了,可以参考一下
c++的接口:https://github.com/BVLC/caffe/blob/master/examples/cpp_classification/classification.cpp
python的接口:http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/classification.ipynb


使用Putty等客户端连接到服务器后,单纯使用“&”不能在后台运行程序,因为只要Putty一退出程序也会随着退出。

解决方法:

使用nohub,例:

      nohup php service.php &

让php程序像服务一样运行在后台,这样就可以使用php或python等写服务了,停止时直接killall 就好了



0 0