在訓練YOLOv3時,我們通常是用預訓練模型進行訓練
代碼如下:
./darknet detector train cfg/voc.data cfg/yolov3-voc.cfg darknet53.conv.74
但有時訓練過程會出現訓練中斷的情況,那么我們如何利用已經選練好的模型重新開始訓練呢?
比如我在backup/文件夾下看到了已經訓練好的權重文件
為了繼續開始訓練,我可以利用這里面的.backup文件繼續訓練
代碼如下:
./darknet detector train cfg/coco.data cfg/yolov3-voc.cfg backup/yolov3-voc.backup
下面列出一些常用的命令
./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