caffe命令列解析

2021-07-31 18:13:22 字數 1675 閱讀 3105

caffe提供三種介面,一般是c++、python、matlab。一般可執行檔案都是放在 ./build/tools/ 資料夾內,在命令列執行命令必須現在該目錄下。(也有可能不在說不定在別的地方,找caffe.exe就對了)

caffe的命令形式如下

caffe 

其中的command有這樣四種:

其中的args引數有:

-solver solver檔案路徑

caffe train -solver examples/mnist/lenet_solver.prototxt
-gpu 那一塊gpu

-snapshot 快照記錄當前狀態

caffe train -solver examples/mnist/lenet_solver.prototxt -snapshot examples/mnist/lenet_iter_5000.solverstate
-weights 用預先訓練好的權重來fine-tuning模型,需要乙個caffemodel

caffe train -solver examples/finetuning_on_flickr_style/solver.prototxt -weights models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel
-iteration 迭代次數,預設為50

-model 定義在protocol buffer檔案中的模型,也可以在solver中選定

-sighup_effect 用來設定當程式發生掛起事件時,執行的操作,可以設定為snapshot, stop或none, 預設為snapshot

-sigint_effect 用來設定當程式發生鍵盤中止事件時(ctrl+c), 執行的操作,可以設定為snapshot, stop或none, 預設為stop

test

之前講的是train命令的引數設定,其實很多都是通用的,train之後

caffe test -model examples/mnist/lenet_train_test.prototxt -weights examples/mnist/lenet_iter_10000.caffemodel -gpu

0-iterations

100

意思是利用訓練好了的權重(-weight),輸入到測試模型中(-model),用編號為0的gpu(-gpu)測試100次(-iteration)。

time

用於顯示程式執行的時間,

caffe time -model examples/mnist/lenet_train_test.prototxt -iterations

10

這裡是lenet 在訓練迭代十次之後所用的時間。

device_query

用來診斷gpu資訊

caffe train -solver examples/mnist/lenet_solver.prototxt -gpu

all

沒啥好說的,挺簡單。

Caffe 命令列解析

sudo sh build tools caffe train solver examples mnist train lenet.shcaffe程式命令列執行格式如下 caffe 其中有這樣四種 build tools caffe train solver examples mnist lenet...

Caffe學習 命令列解析

caffe的執行提供三種介面 c 介面 命令列 python介面和matlab介面。本文先對命令列進行解析,後續會依次介紹其它兩個介面。caffe的c 主程式 caffe.cpp 放在根目錄下的tools資料夾內,當然還有一些其它的功能檔案,如 convert imageset.cpp,train ...

caffe基礎 7 命令列解析

caffe的執行提供三種介面 c 介面 命令列 python介面和matlab介面。本文先對命令列進行解析,後續會依次介紹其它兩個介面。caffe的c 主程式 caffe.cpp 放在根目錄下的tools資料夾內,當然還有一些其它的功能檔案,如 convert imageset.cpp,train ...