1

有沒有人知道在Caffe中繪製獲得的度量值的任何函數?我想繪製火車損失,測試損失和準確性,列車移動平均線等。除了Caffe內置功能外,還有其他功能可以在線使用嗎?如何繪製日誌文件?

編輯: 首先,我跑parse_log.py文件(以下命令):

$python /path/to/caffe/tools/extra/parse_log.py /logfile_path/logfile.log /output_dir 

兩個文件是基於日誌文件(lofile.log.trainlogfile.log.test)創建的。之後,我運行了plot_training_log.py文件。它有類似的選項:

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 

每當我選擇了選項,它顯示如下圖: enter image description here ,並通過選擇選項: enter image description here 但是,每當我想繪製列車的損失數字,它給錯誤:

$python /path/to/caffe/tools/extra/plot_training_log.py.example 6 /output_dir/train_loss_cnn1.png ./logfile.log 
Traceback (most recent call last): 
    File "/home/ss/caffe-master/tools/extra/plot_training_log.py.example", line 191, in <module> 
    plot_chart(chart_type, path_to_png, path_to_logs) 
    File "/home/ss/caffe-master/tools/extra/plot_training_log.py.example", line 117, in plot_chart 
    data = load_data(data_file, x, y) 
    File "/home/ss/caffe-master/tools/extra/plot_training_log.py.example", line 88, in load_data 
    data[1].append(float(fields[field_idx1].strip())) 
ValueError: invalid literal for float(): 0.522037s/50 

我的問題可以摺疊成三個部分:

  1. 這些圖是否正確?網絡表現良好嗎?
  2. 從哪個角度來看這個錯誤源於?我在logfile.log.train(#Iters | Seconds | TrainingLoss | LearningRate)中有以下幾列。

  3. 如何在一個圖表中顯示所有圖表類型?我試圖用逗號來包含它們,例如0,2,3,6,但它顯示錯誤。

非常感謝提前。

回答

2

看看parse_log.py發現於$CAFFE_ROOT/tools/extra
這個python實用程序有助於解析和提取caffe運行日誌中的信息。

+0

謝謝Shai,我以前試過這個,分別顯示不同的地塊只需要一個號碼。例如,通過寫數字6僅繪製列車損失。再次感謝 –

+0

@ S.EB這個工具是通用的,您可以根據自己的具體需求進行調整。 – Shai

0

開始通過執行以下命令,訓練你的模型:

/home/ubuntu/caffe/build/tools/caffe train --solver /home/ubuntu/yourpath/solver.prototxt 2>&1 | tee /home/ubuntu/yourpath/model_train.log 

的訓練日誌將被保存在yourpath/model_train.log。

0

我沒有看過內置劇情腳本caffe的,但是我用腳本here。這隻會繪製您的火車/測試損失,但您可以添加移動平均值計算。

+0

非常感謝您的鏈接 –

0

考慮還安裝DIGITS,它提供了一個顯示所有類型的東西的實時陰謀。

+0

感謝您的評論,DIGITS究竟是什麼?它是否像Caffe的圖形用戶界面?我如何將它安裝在我已經安裝Caffe的設備上?謝謝 –

+0

是的,它或多或少是caffe的GUI。它在數據集和模型管理和組織中非常方便,並且具有實時繪圖功能,可以在訓練過程中爲您節省時間。另一個有趣的特徵是可以用給定的圖像作爲輸入來可視化每層的輸出。 如果您轉到我上面發佈的GitHub倉庫,您會看到安裝指南。不幸的是,它不適用於Caffe可用的所有平臺。 – nicobonne

相關問題