yolo-training

Diagnose and tune YOLO26 training runs from results.csv metrics and loss curves.

1.1k|107|Updated Jul 9, 2025
One-click install
npx skills add https://github.com/fcakyon/claude-codex-settings --skill yolo-training
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yolo-training
Source: https://github.com/fcakyon/claude-codex-settings/tree/main/plugins/ultralytics-dev/skills/yolo-training
Command: npx skills add https://github.com/fcakyon/claude-codex-settings --skill yolo-training

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, and includes references (resource) components.

What problem does it solve?

Training YOLO models often stalls on confusing symptoms: flat mAP, overfitting, diverging loss, or a recall ceiling with no obvious cause. This Skill reads your training run's metrics and maps each symptom to the cheapest effective fix, so you stop guessing at hyperparameters.

Core Features & Use Cases

  • Run Diagnosis: Reads results.csv, loss curves, and confusion matrices to classify problems as undertraining, overfitting, bad LR, label quality, or data imbalance.
  • Ordered Tuning Playbook: Applies fixes cheapest-first: epochs and schedule, then augmentation, loss weights and LR, model size, resolution, and finally data quality.
  • Per-Task Guidance: Covers detection, instance and semantic segmentation, pose, OBB, classification, and depth with task-specific loss weights, fitness metrics, and augmentation notes.
  • Use Case: Your mAP50 is strong but mAP50-95 is weak. The Skill identifies this as a localization problem and walks you through raising box/dfl loss weights, checking ground-truth box tightness, and evaluating object sizes before spending compute on higher resolution.

Quick Start

Ask the assistant to read my runs/detect/train/results.csv and tell me why my YOLO26 model is overfitting and which hyperparameters to change first.

Frequently Asked Questions about yolo-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix overfitting when training a YOLO model?

Overfitting shows as train loss falling while val loss rises. Start with augmentation: mixup at 0.1-0.2, copy_paste if labels have segments, and scale up to 0.9. Then raise weight_decay, and only then reduce epochs or model size.

Why is my mAP50 high but mAP50-95 low in YOLO training?

This pattern means classification and coarse localization work but tight localization fails. Raise box and dfl loss weights together by 1.3x to 2x first. If nothing moves, check ground-truth box tightness and whether objects are too small for the training resolution.

Why does changing lr0 have no effect on YOLO training?

The default optimizer=auto ignores lr0 and momentum, picking MuSGD or AdamW based on iteration count. Set optimizer=AdamW or optimizer=SGD explicitly before your lr0 value takes effect.

How do I improve recall for rare classes in object detection?

First rule out missing annotations and the max_det=300 validation cap. Then use cls_pw between 0.3 and 0.5 for inverse-frequency class weighting, add copy_paste if labels carry segments, or oversample rare-class images in the train list.

What causes YOLO training loss to spike to NaN?

Divergence usually comes from fp16 overflow, so test with amp=False first. Then drop lr0 by 10x, raise warmup_epochs to 5, and check labels for normalized coordinates above 1.0, which produce infinite loss.

When should I use a bigger YOLO model instead of tuning hyperparameters?

Scale up only when train loss is still falling at the end of the schedule and train and val curves sit close together, which indicates underfitting. It is the only case a bigger model reliably fixes; otherwise tune schedule and augmentation first.