pypi ultralytics 8.3.198
v8.3.198 - `ultralytics 8.3.198` Improve `Tuner` with BLX-α gene crossover (#22038)

4 hours ago

🌟 Summary

Smarter hyperparameter tuning and sturdier training/inference across the board. v8.3.198 introduces a much stronger Tuner with BLX-α crossover, unified metric plotting, safer defaults, and multiple robustness fixes (NMS, DDP loss, Intel GPU checks), plus simpler export APIs and flexible torch.compile modes. 🚀

📊 Key Changes

  • Hyperparameter Tuner (priority)
    • BLX-α gene crossover for smarter exploration across top parents, not just single-parent mutation. See PR #22038 🔬
    • Adaptive mutation sigma (decays early for stable convergence), safer mutation bounds, and added close_mosaic to the search space.
    • Search space tweaks (e.g., lower bound for cls gain → 0.1) and consistent type casting.
    • Fitness now uses only mAP@0.5:0.95 for selection, aligning with common benchmarks. 🎯
    • Runtime hygiene: GPU memory cleanup between iterations to reduce OOM/fragmentation.
    • More robust resume logic and CSV/MongoDB handling; cleaner best-iteration management.
  • Exporter API cleanup
    • Export functions now return just the output path string (except TF SavedModel which also returns the Keras model). Simpler and lighter. See PR #22009 📦
  • torch.compile flexibility
    • compile accepts True/False or a mode string "default" | "reduce-overhead" | "max-autotune" across train/val/predict. See PR #21999 ⚙️
  • Training robustness
    • Unwrap DDP/compiled models before loss calculation to avoid wrapper-related issues. See PR #22016 🧩
  • NMS correctness
    • Fixed early-exit and sorting in TorchNMS to reduce false positives and improve stability. See PR #22014
  • Unified results plotting
    • plot_results auto-detects metrics/losses and works for all tasks; logic centralized in BaseTrainer. See PR #22026 📈
  • Segmentation fixes
    • Correct mask resizing/shape handling in validation (e.g., mask_ratio=1) and faster, correct mask plotting with overlap_mask. See PR #22037, PR #22031 🖼️
  • Stability & docs
    • Dataset cache auto-recovers on ModuleNotFoundError. See PR #22025
    • Intel GPU discovery now catches all exceptions to prevent environment crashes. See PR #22034
    • Clearer configs and tracker YAMLs; improved docs for compile args; corrected detection boxes column order (track_id position); quickstart removes Seaborn from manual install. PRs #22011, #22028, #22035
    • Construction-PPE dataset docs add a “Business Value” section for real-world ROI. See PR #22029 👷📈

🎯 Purpose & Impact

  • Better models, faster: BLX-α crossover + adaptive mutation helps find stronger hyperparameters in fewer iterations, especially for YOLO11 training. 🚀
  • More reliable training: Unwrapping before loss and flexible compile modes reduce edge-case failures with DDP and torch.compile.
  • Fewer false positives: NMS logic fixes stabilize detections across datasets.
  • Cleaner APIs: Exporters returning a path simplifies pipelines, reduces memory, and avoids unexpected large return objects.
  • Easier metrics analysis: Unified plotting works consistently across detect/segment/pose/classify; less duplication, clearer visuals.
  • Smoother ops: GPU memory cleanup between tuning iterations, robust dataset cache handling, and environment-safe Intel GPU checks reduce friction in diverse setups.
  • Clarity for everyone: Improved YAML/docs, corrected detection box order, and streamlined Quickstart make onboarding and maintenance simpler.

Quick examples

  • Tuning with the improved Tuner:
from ultralytics import YOLO

model = YOLO("yolo11s.yaml")
model.tune(
    device=0,
    data="coco128.yaml",
    optimizer="AdamW",
    epochs=100,
    batch=8,
    compile=False,
    plots=False,
    val=False,
    save=False,
    workers=16,
    project="tune-yolo11s-scratch-coco128-100e",
    iterations=1000,
)
  • Using compile modes:
from ultralytics import YOLO

model = YOLO("yolo11n.pt")
model.train(data="coco8.yaml", epochs=3, compile="reduce-overhead")  # or "default", "max-autotune", True/False
  • Export now returns a file path:
from ultralytics import YOLO

model = YOLO("yolo11n.pt")
onnx_path = model.export(format="onnx")  # 'onnx_path' is a string

What's Changed

  • Clean up Exporter and remove unnecessary None placeholder by @Laughing-q in #22009
  • Allow settable compile mode for torch.compile by @Laughing-q in #21999
  • Improve config YAMLs by @glenn-jocher in #22011
  • Unwrap DDP model before loss calculation by @Y-T-G in #22016
  • Fix TorchNMS.nms() early exit logic by @Y-T-G in #22014
  • Revise detection boxes argument documentation by @daniel-mooney in #22028
  • Fix mask plotting when number of objects equal to number of images in a batch by @Y-T-G in #22031
  • docs: 📝 remove seaborn package from manual installation dependencies list from quickstart docs by @onuralpszr in #22035
  • Catch all exceptions during Intel GPU discovery by @Y-T-G in #22034
  • Add business value section to Construction-PPE dataset by @UltralyticsAbi in #22029
  • Reset labels cache when loading with incompatible numpy version by @Y-T-G in #22025
  • Faster torch.Tensor.shape[0] to get length for torch.Tensor by @Laughing-q in #22021
  • Clean up and unify plot_results for detect/segment/pose/obb/classify tasks by @Laughing-q in #22026
  • Fix mask shape mismatch when validating with mask_ratio=1 by @Laughing-q in #22037
  • ultralytics 8.3.198 Improve Tuner with BLX-α gene crossover by @glenn-jocher in #22038

New Contributors

Full Changelog: v8.3.197...v8.3.198

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.