赞
踩
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)
`
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。