如果想要繪出訓練曲線圖,就要紀錄迭帶過程的資訊
可以利用
$ command 2>&1 | tee log.txt的方式
把caffe印在螢幕上的資訊存成檔案
這裡試個用caffe裡mnist測試
$ sh examples/mnist/train_lenet.sh 2>&1 | tee mnist.log就可以得到 mnist.log檔案
把訓練過程繪成曲線圖
用import matplotlib.pyplot as plt或gnuplot應該都可以
這裡用gnuplot
參考/caffe-path/tools/extra/裡的plot_log.gnuplot.example
裏面有簡單教學
原來/caffe-path/tools/extra/裏面有一些parse的工具可以運用
$ ./parse_log.sh mnist.log得到mnist.log.train, mnist.log.test
$ gnuplot打開gnuplot
如果沒裝先安裝 $ sudo apt-get install gnuplot
按照plot_log.gnuplot.example裡的設定後
gnuplot> reset gnuplot> set terminal png gnuplot> set output "train.png" gnuplot> set style data lines gnuplot> set key right gnuplot> set title "Training loss vs. training iterations" gnuplot> set xlabel "Training iterations" gnuplot> set ylabel "Training loss" gnuplot> plot "mnist.log.train" using 1:3 title "mnist"就可以繪出圖了
Note.
在parse資料時,也可以用
cat log | grep ", loss =" | awk '{printf $6" "$9"\n"}' > datagrep抓取我們的目地資料的行,例如這裡想要拿到"loss"的值,awk print $i是指印出該行裡第i個資料,最後將資料存到data檔案裡
參考
Caffe Logging and Loss Plotting
How to save training loss, training accuracy and test accuracy into .txt files?
Caffe学习系列(19): 绘制loss和accuracy曲线
Play Spades with Jokers for Free Online - Lucky Club
回覆刪除Play Spades and other popular card games online luckyclub.live including Whist, Euchre, Gin Rummy, Euchre, Euchre, Gin Rummy and many more variations.