samaritan_v1 / data /train.py
johnlockejrr's picture
Upload 2 files
e742b12 verified
raw
history blame contribute delete
698 Bytes
from ultralytics import YOLO
# Train only the `l` or `x` if you can
models = [
"yolo11l-seg.pt",
"yolo11m-seg.pt",
"yolo11n-seg.pt",
"yolo11s-seg.pt",
"yolo11x-seg.pt"
]
for model_name in models:
model = YOLO(model_name) # load a pretrained model
# Train the model with memory-saving parameters
results = model.train(
data="./sam_40_mss_lines/config-Y-T-G.yaml",
epochs=200,
imgsz=1024,
patience=50,
optimizer='SGD',
simplify=False,
retina_masks=True,
batch=8,
name=f"sam_{model_name.replace('.pt', '')}_1024",
#device=[0,1],
workers=2 # Reduce number of workers
)