Fine‑Tune the YOLOv11n Model
Train a YOLOv11n model on your custom dataset using Ultralytics. This step performs the actual fine‑tuning and requires significant compute resources.
Fine‑tuning will adjust the weights of a pre‑trained YOLOv11n model to detect your specific classes. Use a machine with a powerful GPU and plenty of memory. Adjust the batch size to fit your hardware; recommended values are provided in the table below.
bash
# Train YOLOv11n on your dataset
yolo train model=models/yolo11n.pt data=data.yaml epochs=100 imgsz=640 batch=16 project=runs name=y11n_finetune
Recommended batch sizes
Hardware Recommendedbatch
M1 / M2 / M3 MacBook Air
8
M1 / M2 / M3 Pro (16 GB)
16
M1 / M2 / M3 Max (32–64 GB)
32
Intel Mac (CPU only)
4 (or 2)
Adjust batch on the command line to match your hardware. Use the device=mps argument on Apple Silicon to leverage the Metal GPU.