forked from huangzongmou/yolov8_Distillation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
train.py
29 lines (17 loc) · 1 KB
/
train.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import torch
import pdb
from ultralytics import YOLO
# modelL = YOLO('/home/huangzm/code/mycode/pytorch/ultralytics/runs/detect/train37/weights/best.pt')
# model_t = YOLO('/home/huangzm/code/mycode/pytorch/ultralytics/runs/detect/train32/weights/best.pt')
# modelL = YOLO('/home/huangzm/code/mycode/pytorch/ultralytics/runs/detect/coco_v8l/weights/best.pt')
# model_t = YOLO('/home/huangzm/code/mycode/pytorch/ultralytics/runs/detect/train37/weights/best.pt')
# model_t = YOLO('yolov8l.pt')
# success = modelL.export(format="onnx",device="cpu")
data = "/home/huangzm/code/mycode/pytorch/yolov8/Knowledge_Distillation/ultralytics/datasets/coco.yaml"
# model_t.model.model[-1].set_Distillation = True
# model_t.train(data=data, epochs=100, imgsz=640, Distillation = None)
model_s = YOLO('yolov8n.pt')
# success = modeln.export(format="onnx")
# modelL.val(data=data)
# model_s.train(data=data, epochs=100, imgsz=640, Distillation = model_t.model)
model_s.train(data=data, epochs=100, imgsz=640, Distillation = None)