-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyolo_train.py
More file actions
36 lines (30 loc) · 976 Bytes
/
yolo_train.py
File metadata and controls
36 lines (30 loc) · 976 Bytes
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
27
28
29
30
31
32
33
34
35
36
from ultralytics import YOLO
model = YOLO("/home2020/home/geo/ggrimmer/plastigiessen/SCRIPT_MODEL/TRAIN3/yolov8n.pt")
model.train(
data="/home2020/home/geo/ggrimmer/plastigiessen/SCRIPT_MODEL/TRAIN3/train3.yaml", # Chemin vers le fichier data.yaml
epochs=200, # Nombre d'époques
batch=32, # Taille du batch
imgsz=1280, # Taille des images
device=[0,1], # Spécifie les GPU à utiliser
workers=8, # Ajuste le nombre de workers pour optimiser le data loading
# Augmentations
flipud=0.5,
fliplr=0.5,
mosaic=1.0,
hsv_h=0.015,
hsv_s=0.7,
hsv_v=0.4,
perspective=0.0005,
scale=0.5,
shear=0.0,
translate=0.1,
# Optimisation
lr0=0.001,
lrf=0.2,
momentum=0.937,
weight_decay=0.0005,
# Early stopping
patience=10, # Stop si la validation ne s'améliore pas après 10 epochs
# Reduce LR on Plateau
cos_lr=True # Active un annealing cosine learning rate scheduler
)