首次訓練:
python train.py --config=yolact_coco_custom_config --resume=weights/yolact_plus_resnet50_54_800000.pth --only_last_layer --batch_size 56
首次訓練使用了權重文件“yolact_plus_resnet50_54_800000.pth”,但我的樣本數量有限,為避免過擬合,所以使用“only_last_layer”參數進行微調(Fine-tune)。
微調:在自己的數據集上訓練一個新的深度學習模型時,一般采取在預訓練好的模型上進行微調的方法。
batch_size參數:根據官方支持多GPU的說明,我的服務器有7張顯卡,batch size = 8*gpu數量。
從中斷的權重文件繼續訓練:
python train.py --config=yolact_coco_custom_config --resume=weights/yolact_coco_custom_226_9500.pth --start_iter=-1 --batch_size 56
“yolact_coco_custom_226_9500.pth”是我迭代10萬次后得到的權重文件,可在此基礎上繼續訓練。
據說yolact至少訓練10萬次以上才能得到好的效果,暫未驗證。