天天看點

Darknet如何繼續用已有模型繼續訓練 clear指令微調模型

正常情況下,很多時候都是直接使用預訓練模型進行訓練

./darknet detector train cfg/voc.data cfg/yolov3-voc.cfg darknet53.conv.74
           

如果出現意外還可以繼續使用.backup檔案進行訓練

./darknet detector train cfg/coco.data cfg/yolov3.cfg backup/yolov3.backup 
           

如果加上-clear  則模型會從初始狀态開始

./darknet detector train cfg/coco.data cfg/yolov3.cfg backup/yolov3.backup -clear
           

初始指的是疊代次數學習率,具體可以看cfg檔案裡面的參數。

下面是一些常用的指令記錄一下

./darknet detector test <data_cfg> <models_cfg> <weights> <test_file> [-thresh] [-out]
./darknet detector train <data_cfg> <models_cfg> <weights> [-thresh] [-gpu] [-gpus] [-clear]
./darknet detector valid <data_cfg> <models_cfg> <weights> [-out] [-thresh]
./darknet detector recall <data_cfg> <models_cfg> <weights> [-thresh]
           
'<>'必選項,’[ ]‘可選項      

  data_cfg:資料配置檔案,eg:cfg/voc.data

  models_cfg:模型配置檔案,eg:cfg/yolov3-voc.cfg

  weights:權重配置檔案,eg:weights/yolov3.weights

  test_file:測試檔案,eg:*test.txt

  -thresh:顯示被檢測物體中confidence大于等于 [-thresh] 的bounding-box,預設0.005

  -out:輸出檔案名稱,預設路徑為results檔案夾下,eg:-out "" //輸出class_num個檔案,檔案名為class_name.txt;若不選擇此選項,則預設輸出檔案名為comp4_det_test_"class_name".txt

  -i/-gpu:指定單個gpu,預設為0,eg:-gpu 2

  -gpus:指定多個gpu,預設為0,eg:-gpus 0,1,2