当前位置:   article > 正文

yolov8断点续训教程

yolov8断点续训

1.打开搜索功能,搜素check_resume()函数
将resume = self.args.resume注释掉
2.找到resume_training()函数,ckpt =torch.load(上次中断生成的last.pt的路径)
ckpt = torch.load(‘runs/detect/train160/weights/last.pt’)
3.将以下文件赋值导自己的py文件上,执行即可

from ultralytics import YOLO
import torch
# Load a model
model = YOLO('ultralytics/cfg/models/v8/yolov8-C2f-DySnakeConv-GAM.yaml')  # build a new model from YAML   默认是yolov8n/
model = YOLO('runs/detect/train160/weights/last.pt')
model = YOLO('ultralytics/cfg/models/v8/yolov8-C2f-DySnakeConv-GAM.yaml').load('runs/detect/train160/weights/last.pt')  # build from YAML and transfer weights

if __name__ == '__main__':
# Train the model    #your code
    print(torch.cuda.is_available())
    print(torch.cuda.device_count())
    model.train(data='ultralytics/cfg/datasets/custom_data.yaml', epochs=400, imgsz=640, resume=True)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

`

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/95247
推荐阅读
相关标签
  

闽ICP备14008679号