训练模型并保存日志文件
首先建立一个训练数据的脚本文件train.sh,其内容如下,其中,2>&1 | tee examples/mnist/mnist_train_log.log 是log日志文件的保存目录。
#!/usr/bin/env sh
set -e
TOOLS=./build/tools
$TOOLS/caffe train --solver=examples/mnist/lenet_solver.prototxt 2>&1 | tee examples/mnist/mnist_train_log.log
训练完成后,会在examples/mnist文件夹下生成mnist_train_log.log日志
python plot_training_log.py 6 train_loss.png mnist_train_log.log
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