train.py中有一个参数是resume,在yolov5中,这个参数只需要设定为True,其就会继续上次没有训练完的任务,但是在yolov8中其是指定一个pt的路径,只需要在resume中指定对应未完成任务中的last.pt即可,如下所示:
正常训练:
python train.py --weight yolov8n.pt --yaml ultralytics/models/v8/yolov8n.yaml --data /xxx/data.yaml --workers 8 --batch 32 --fraction 0.1
续训:
python train.py --data /home/xxx/data.yaml --workers 8 --batch 32 --fraction 0.1 --resume runs/xxx/weights/last.pt