plot accuracy + loss
详情可见:http://www.2cto.com/kf/201612/575739.html
1. caffe保存训练输出到log 并绘制accuracy loss曲线:
之前已经编译了matcaffe 和 pycaffe,caffe中其实已经自带了这样的小工具。caffe-master/tools/extra/parse_log.sh caffe-master/tools/extra/extract_seconds.py和 caffe-master/tools/extra/plot_training_log.py.example;拷贝以上文件到当前工作目录下:
2. 保存输出到log文件,更改脚本文件 train_caffenet.sh;在exampless/test 目录下就会有一个log开头的文件
#!/usr/bin/env sh
TOOLS=./build/tools
LOG=examples/cifar10/log_results/log-
'data +%Y-%m-%d-%H-%S'
.log
$TOOLS/caffe train
--solver=examples/cifar10/cifar10_quick_solver.prototxt -gpu all
2
>&
1
| tee $LOG
其中0代表曲线类型, save.png 代表保存的图片名称 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
画出网络结构图
安装graphviz不要用pip install安装,否则还是会找不到可执行程序
安装:$ sudo apt-get insall graphviz
然后安装pydot:$ pip install pydot
其中pyparsing会自动安装
2. 进入 caff-root/python中,输入即可
$ python draw_net.py --rankdir TB ../examples/cifar10/cifar10_quick_train_test.prototxt ../examples/cifar10/log_results/net.jpg