"model.properties" did not exist on "e6dcd9bd508da5e3d14ac000eb2398933c872774"
train.py 847 Bytes
Newer Older
chenzk's avatar
v1.0  
chenzk committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from ultralytics import YOLOv10

model = YOLOv10()
# If you want to finetune the model with pretrained weights, you could load the 
# pretrained weights like below
# model = YOLOv10('yolov10s.pt')
# Or
# model = YOLOv10.from_pretrained('jameslahm/yolov10{n/s/m/b/l/x}')


# model.train(data='coco.yaml', model='yolov10s.yaml', epochs=500, batch=256, imgsz=640, resume=True, device='0,1,2,3') # for resume
model.train(data='coco.yaml', model='yolov10s.yaml', epochs=500, batch=256, imgsz=640, device='0,1,2,3')
# Note that you can upload your trained model to HuggingFace Hub like below
# model.push_to_hub("reponame", config={"model": "yolov10n/s/m/b/l/x.yaml"})


'''
if you want to resume, need to add something here:
ultralytics/engine/trainer.py:__init__:

overrides["resume"] = 'runs/detect/train/weights/last.pt'
self.args.resume = True
'''