在caffe的训练过程中,大家难免想图形化自己的训练数据,以便更好的展示结果。如果自己写代码记录训练过程的数据,那就太麻烦了,caffe中其实已经自带了这样的小工具 caffe-master/tools/extra/parse_log.sh caffe-master/tools/extra/extract_seconds.py和 caffe-master/tools/extra/plot_training_log.py.example ,使用方法如下:
1.记录训练日志
在训练过程中的命令中加入一行参数 ,实现Log日志的记录
TOOLS=./build/tools GLOG_logtostderr=0 GLOG_log_dir=deepid/deepid2/Log/ \ $TOOLS/caffe train \ --solver=deepid/deepid2/deepid_solver.prototxt
2.解析训练日志
将最上面说的3个脚本文件拷贝到Log 文件夹下,执行:
./parse_log.sh caffe.wujiyang-ubuntu.wujiyang.log
3.生成图片
执行
./plot_training_log.py.example 0 save.png caffe.wujiyang-ubuntu.wujiyang.log
caffe中支持很多种曲线绘制,通过指定不同的类型参数即可,具体参数如下
Notes: 1. Supporting multiple logs. 2. Log file name must end with the lower-cased ".log". Supported chart types: 0: Test accuracy vs. Iters 1: Test accuracy vs. Seconds 2: Test loss vs. Iters 3: Test loss vs. Seconds 4: Train learning rate vs. Iters 5: Train learning rate vs. Seconds 6: Train loss vs. Iters 7: Train loss vs. Seconds