pypi ultralytics 8.3.203
v8.3.203 - `ultralytics 8.3.203` Restore `GradScaler` on resuming training (#22189)

10 hours ago

🌟 Summary

Safer, smoother training resumes with AMP plus sturdier exports and better version checks. This release improves mixed‑precision resume stability, future‑proofs ONNX opset selection, tightens export requirements (OpenVINO/CoreML), and polishes compatibility across models and PyTorch versions. 🚀🛡️

📊 Key Changes

  • Training resume reliability (priority)
    • Restore AMP GradScaler when resuming training to keep loss scaling stable PR #22189 (fixes #21913, #17282) ⚖️
  • ONNX export robustness
    • Smart opset selection via best_onnx_opset() and IR version cap for better ONNX Runtime compatibility PR #22142 🔧
    • Clear Torch gating for opset logic (Torch ≥ 1.13 uses ONNX_MAX_OPSET-1; older Torch uses a map) PR #22155 🧭
  • Export requirements updates
    • OpenVINO export now requires PyTorch ≥ 2.1 PR #22156 ⚠️
    • CoreML export now requires PyTorch ≥ 1.11 PR #22162 🍎
  • Model and training flow improvements
    • Disable compile=True for YOLO-World and YOLOE with clear assertions; keep compile-optimized path when enabled elsewhere PR #22148 🧠
    • RTDETR requires PyTorch ≥ 1.11 with runtime asserts and aligned tests PR #22161 🎯
  • Data and inference fixes
    • Correctly detect image URLs with query strings (no infinite stream loop) PR #22122 🌐✅
  • Compatibility cleanups
    • Unified meshgrid version flags to avoid errors on older Torch versions PR #22158, PR #22163 🧩
    • FastSAM workaround for PyTorch 1.9 mask summation bug PR #22169 🩹
  • Reliability and UX
    • Warn if multiple Ultralytics installations are detected to prevent conflicts PR #22131 🔍
    • Safer tuner cleanup by checking best_save_dir exists PR #22137 🧹
  • Docs and tooling
    • Added reference docs for best_onnx_opset and multiple-install checks; improved slug generation for content tabs; corrected CI badge; enhanced Model YAML Guide and nav PRs #22142, #22157, #22184, #22154 📚
    • Pin dev tooling: uv set to 0.8.19 for consistent environments PR #22186 🧰

🎯 Purpose & Impact

  • More reliable mixed-precision resumes 🎛️
    • Restoring the GradScaler avoids instability and prolonged warm-up when continuing training with AMP.
  • Fewer export surprises across environments 📦
    • ONNX opset selection and IR capping reduce runtime/load errors.
    • Clear, upfront version requirements for OpenVINO (Torch ≥ 2.1) and CoreML (Torch ≥ 1.11) prevent confusing failures.
  • Better user guidance and DX 🧭
    • Early warnings for multiple installs help resolve version/path conflicts quickly.
    • Compile behavior is explicit for YOLO-World and YOLOE, reducing trial-and-error.
  • Broader compatibility and stability 🧱
    • Meshgrid and FastSAM fixes ensure older Torch users can run without errors.
  • Smoother tuning and documentation experience ✨
    • Safer cleanup logic and improved docs navigation/references make workflows clearer and more predictable.

Tip: If you export to OpenVINO or CoreML, verify your PyTorch version first:

import torch
print(torch.__version__)

Upgrade instructions: see the official PyTorch install guide on the PyTorch website.

What's Changed

Full Changelog: v8.3.202...v8.3.203

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.