-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
23 lines (22 loc) · 989 Bytes
/
Copy pathtrain.py
File metadata and controls
23 lines (22 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import warnings
warnings.filterwarnings('ignore')
from ultralytics import YOLO
if __name__ == '__main__':
for yaml_name in ['yolo11-FPSC-RGCSPELAN','yolo11-FPSC']:
model = YOLO(f'/final/FRNet/models/innovations/{yaml_name}.yaml')
model.train(data='/final/datasets/STBD-08/STBD.yaml',
cache=False,
imgsz=640,
epochs=300,
batch=32,
close_mosaic=0,
workers=4, # Windows下出现莫名其妙卡主的情况可以尝试把workers设置为0
# device='0',
optimizer='SGD', # using SGD
# patience=0, # set 0 to close earlystop.
# resume=True, # 断点续训,YOLO初始化时选择last.pt
# amp=False, # close amp
# fraction=0.2,
project='runs/train/STBD-08',
name=yaml_name,
)