pypi ultralytics 8.4.158
v8.4.158 - `ultralytics 8.4.158` Keep mosaic closed after an OOM batch auto-reduction (#26257)

4 hours ago

🌟 Summary

Ultralytics 8.4.158 improves YOLO26 training reliability, model export compatibility, data handling, inference backends, and Ultralytics Platform workflows. πŸš€

πŸ“Š Key Changes

  • πŸ”„ Mosaic augmentation now stays closed after OOM recovery

    • Fixed a training issue where automatic batch-size reduction rebuilt the dataloader and unintentionally re-enabled Mosaic augmentation.
    • The trainer now re-arms the mosaic-closing logic after rebuilding the pipeline, ensuring the augmentation state matches the training log and configuration.
  • βš™οΈ More reliable AutoBatch sizing

    • AutoBatch no longer treats a failed batch-one probe caused by BatchNorm at very small image sizes as a GPU memory limit.
    • Added CUDA coverage for small image sizes to prevent regressions.
  • 🧠 Improved data loading and caching

    • RAM image caches can now be shared more efficiently with spawn and forkserver DataLoader workers.
    • Linux DataLoader workers start lazily, reducing the risk of image-decoder deadlocks during initialization.
    • Dataset hyperparameters are copied before transforms modify them, preventing one dataset from changing settings used by later datasets.
    • Disk caching now uses a smaller safety margin and handles failed cache writes more safely.
  • πŸ“¦ Stronger download and dataset handling

    • safe_download() can resume interrupted downloads with HTTP Range requests, handle encoded responses, and better tolerate temporary server errors.
    • Invalid files named as archives are now returned as files instead of being mistaken for extracted datasets.
    • NDJSON conversion keeps at least one image when a valid nonzero fraction would otherwise select none.
  • πŸ“€ More accurate model exports

    • Exported models with missing or invalid class names now infer the correct class count from the model head instead of defaulting to 999 names.
    • This improves metadata consistency for legacy detection and classification checkpoints.
    • TorchScript inference is stabilized on older PyTorch versions by avoiding a repeated-inference crash.
    • TensorRT now raises clear errors when dynamic shapes are rejected or inference execution fails.
  • 🎭 Better SAM2 video masks

    • SAM2 video predictions now correctly enforce non-overlapping masks before thresholding.
    • The highest-scoring object owns each pixel, preventing tracked objects from incorrectly covering one another.
    • CPU semantic segmentation postprocessing is also faster through improved class-index selection.
  • 🍎 Expanded Apple deployment support

    • Core AI assets now include model descriptions and are documented as an opt-in path in the Ultralytics iOS SDK and Flutter plugin.
    • Core ML remains the default and recommended Apple deployment format, especially for broader device compatibility.
    • Core AI remains limited to newer Apple operating systems and Apple silicon export environments.
  • πŸ› οΈ Ultralytics Platform improvements

    • Added class-prompted annotation using hosted open-source models and paid vision providers for detection datasets with one to 100 classes.
    • Agents workflows now support HTTPS webhook actions in addition to Slack notifications.
    • TIFF originals can be stored without re-encoding.
    • Platform documentation now covers provider API keys, annotation behavior, upload handling, and the corrected ARKitScenes raw-data workflow.
  • πŸ“š Documentation and compatibility updates

    • ExecuTorch guidance now explains that Ultralytics installs a compatible version automatically.
    • ARKitScenes documentation now uses the raw subset and its approximately two-hertz frame sampling process.
    • System font lookup rescans installed fonts when Matplotlib’s cached list is outdated.

🎯 Purpose & Impact

  • More predictable training: Mosaic augmentation remains disabled when expected, even after automatic OOM recovery, improving reproducibility and avoiding misleading training behavior.
  • Fewer training failures: AutoBatch, caching, DataLoader startup, and dataset conversion fixes make training more robust across hardware, operating systems, and small image sizes.
  • Safer deployment: Exported metadata now matches the actual model, while TorchScript and TensorRT failures produce clearer and earlier errors.
  • Cleaner segmentation results: SAM2 video users should see fewer overlapping tracked masks and more consistent object ownership.
  • Broader platform workflows: Users can annotate datasets with natural-language or vision-language models, connect workflows to web services, and preserve TIFF source files.
  • Better Apple integration: Core AI is usable as an opt-in for supported iOS 27 devices, while Core ML remains the safest default for most Apple deployments. 🍎

What's Changed

  • Ignore AutoBatch probe failures below the first successful size by @fcakyon in #26224
  • Cover AutoBatch at imgsz below 2x stride in the GPU tests by @glenn-jocher in #26248
  • Set the Core AI asset description and document Core AI as an SDK opt-in by @glenn-jocher in #26230
  • Remove Core AI from the Platform export format docs by @glenn-jocher in #26249
  • Resume safe_download retries with Range requests by @glenn-jocher in #26250
  • Avoid fork-inherited image decoder deadlocks in Linux data loaders by @glenn-jocher in #26085
  • Share RAM image caches across DataLoader workers by @glenn-jocher in #26086
  • Make safe_download robust to encoded responses, curl resumes, and 5xx bursts by @glenn-jocher in #26251
  • Add class names fallback for legacy checkpoints on export by @venu-banaras in #24715
  • Reduce the disk cache safety margin and guard failed cache writes by @Swish78 in #26112
  • Remove the ExecuTorch upgrade advice that installs a runtime the package rejects on torch < 2.13 by @raimbekovm in #26263
  • Fix repeated TorchScript inference crash on torch<2.1 by @glenn-jocher in #26264
  • Apply the SAM2 video non-overlapping mask constraint on the float masks and select the mask owner with max indices by @raimbekovm in #26262
  • Select semantic class indices with max instead of argmax on CPU by @raimbekovm in #26261
  • Document the ARKitScenes raw subset and its 2 Hz frame sampling by @Bovey0809 in #26260
  • Align Platform docs with tiff passthrough, agents webhooks and class-prompted annotation models by @raimbekovm in #26258
  • Rescan system fonts in check_font when the cached font list misses by @cainiao33 in #26256
  • Raise on rejected TensorRT shapes and executions by @aswanth-07 in #26268
  • Return the file itself when an archive-suffixed download is not a zip or tar by @cainiao33 in #26255
  • Keep a nonzero ndjson conversion fraction from selecting zero images by @cainiao33 in #26254
  • Stop dataset construction from mutating the caller's hyp namespace by @cainiao33 in #26266
  • Preserve model class counts in export name fallbacks by @aswanth-07 in #26253
  • ultralytics 8.4.158 Keep mosaic closed after an OOM batch auto-reduction by @rahultechenable in #26257

New Contributors

Full Changelog: v8.4.157...v8.4.158

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.