【Caffe】训练过程中保存训练的loss和acc信息到log日志文件

在命令行运行训练或测试命令后添加”2>&1|tee train.log” ,例如:

python fine_tune.py 0 ./solver.prototxt ../../../bvlc_caffenet/bvlc_reference_caffenet.caffemodel 2>&1|tee train.log

tee表示在终端显示。

通过cat命令查看最后20行数据:

cat train.log|tail -n 20

具体显示如下:

I0830 18:05:40.622890  7130 sgd_solver.cpp:105] Iteration 1940, lr = 1e-12
I0830 18:05:47.979542  7130 solver.cpp:330] Iteration 1960, Testing net (#0)
I0830 18:05:50.048022  7130 solver.cpp:397]     Test net output #0: accuracy = 1
I0830 18:05:50.048081  7130 solver.cpp:397]     Test net output #1: loss = 7.20062e-07 (* 1 = 7.20062e-07 loss)
I0830 18:05:50.068387  7130 solver.cpp:218] Iteration 1960 (2.11749 iter/s, 9.44515s/20 iters), loss = 1.32755e-05
I0830 18:05:50.068452  7130 solver.cpp:237]     Train net output #0: loss = 1.32606e-05 (* 1 = 1.32606e-05 loss)
I0830 18:05:50.068473  7130 sgd_solver.cpp:105] Iteration 1960, lr = 1e-12
I0830 18:05:57.429546  7130 solver.cpp:330] Iteration 1980, Testing net (#0)
I0830 18:05:59.485313  7130 solver.cpp:397]     Test net output #0: accuracy = 1
I0830 18:05:59.485383  7130 solver.cpp:397]     Test net output #1: loss = 7.19466e-07 (* 1 = 7.19466e-07 loss)
I0830 18:05:59.505913  7130 solver.cpp:218] Iteration 1980 (2.1193 iter/s, 9.43709s/20 iters), loss = 1.23685e-06
I0830 18:05:59.505990  7130 solver.cpp:237]     Train net output #0: loss = 1.2219e-06 (* 1 = 1.2219e-06 loss)
I0830 18:05:59.506009  7130 sgd_solver.cpp:105] Iteration 1980, lr = 1e-12
I0830 18:06:06.841506  7130 solver.cpp:447] Snapshotting to binary proto file finetune_w592_iter_2000.caffemodel
I0830 18:06:08.052018  7130 sgd_solver.cpp:273] Snapshotting solver state to binary proto file finetune_w592_iter_2000.solverstate
I0830 18:06:09.077206  7130 solver.cpp:310] Iteration 2000, loss = 4.80608e-07
I0830 18:06:09.077273  7130 solver.cpp:330] Iteration 2000, Testing net (#0)
I0830 18:06:11.133579  7130 solver.cpp:397]     Test net output #0: accuracy = 1
I0830 18:06:11.133636  7130 solver.cpp:397]     Test net output #1: loss = 7.15293e-07 (* 1 = 7.15293e-07 loss)
I0830 18:06:11.133651  7130 solver.cpp:315] Optimization Done.

 

你可能感兴趣的:(Caffe,保存日志)