ultralytics v8.4.140

v8.4.140

v8.4.140 - Fix grayscale TIFF training channel mismatch (#26061)

Added 1
  • Added cloudpickle dependency to support model state transfer in distributed training
Changed 3
  • Single-frame NumPy inputs now bypass an unnecessary stacking operation to improve preprocessing speed
  • Expanded regression coverage for TIFF training to include grayscale TIFF data in training, validation, prediction, and export tests
  • Updated inference and validation documentation to reflect corrected model-state preservation behavior
Fixed 8
  • Fixed grayscale TIFF channel handling to ensure single-frame grayscale TIFF images respect the requested color format and prevent three-channel models from receiving one-channel batches
  • Preserved model state during inference and validation by operating on independent model copies to prevent fusion, FP16 conversion, or configuration changes from permanently modifying the caller's model
  • Improved distributed training reliability by providing DDP workers with the parent trainer's prepared model, arguments, and callbacks to retain in-memory weight changes and custom class names
  • Improved weight loading and provenance to preserve correct training source and prefer EMA weights when available while refreshing predictor caches after model changes
  • Enhanced fusion detection to generate a warning when fused pretrained weights are loaded into an unfused model and improved accuracy for convolutional, reparameterized, and end-to-end YOLO26 components
  • Made exports safer by operating on an isolated model copy before modifying names or head settings to keep the original model unchanged
  • Model.tune() now preserves weights that were loaded or modified in memory instead of rebuilding from the original model path on each tuning iteration
  • Prevented small dataset fractions from discarding all data by retaining at least one image in positive sampling fractions

From ultralytics

🌟 Summary

v8.4.140 improves training reliability and model-state preservation, led by a fix for grayscale TIFF datasets that could previously crash YOLO26 segmentation training.

📊 Key Changes
  • 🖼️ Fixed grayscale TIFF channel handling (PR #26061, @glenn-jocher)
    Single-frame grayscale TIFF images now respect the requested color format. This prevents three-channel models from receiving one-channel batches and failing at the first convolution. Existing support for color TIFFs, multipage files, four-channel images, and multispectral stacking is preserved.

  • 🧪 Expanded regression coverage for TIFF training
    The existing multichannel test now also trains, validates, predicts, and exports with grayscale TIFF data.

  • 🧠 Preserved model state during inference and validation (PR #26062)
    Prediction and standalone validation now operate on independent model copies, preventing inference-time fusion, FP16 conversion, or end-to-end configuration changes from permanently modifying the caller’s model.

  • 🚀 More reliable distributed training (PR #26050)
    DDP workers now receive the parent trainer’s prepared model, arguments, and callbacks. In-memory weight changes, custom class names, and application callbacks are therefore retained during multi-GPU training. The release adds cloudpickle to support this state transfer.

  • 🎯 Improved weight loading and provenance (PR #26039)
    Loading weights from modules, checkpoint dictionaries, or files now preserves the correct training source and prefers EMA weights when available. Predictor caches are refreshed after model changes, reducing the risk of stale inference behavior.

  • 🔧 Safer fusion detection and calibration (PR #26045)
    Fused pretrained weights now generate a warning when loaded into an unfused model. Fusion detection is more accurate for convolutional, reparameterized, and end-to-end YOLO26 components. Depth calibration also preserves a trainable, saveable model state.

  • 📦 Safer exports (PR #26052)
    Exporting works on an isolated model copy before modifying names or head settings. This keeps the original model unchanged and avoids copying YOLOWorld’s large cached CLIP encoder unnecessarily.

  • 🧬 Tuning now uses the caller’s loaded model (PR #26053)
    Model.tune() preserves weights that were loaded or modified in memory instead of rebuilding each tuning iteration from the original model path.

  • 📈 Small dataset fractions no longer discard all data (PR #26049)
    Positive sampling fractions now retain at least one image, avoiding dataset-loading failures caused by rounding very small fractions down to zero. Explicit zero splits remain supported.

  • Faster single-image preprocessing (PR #25989)
    Single-frame NumPy inputs bypass an unnecessary stacking operation, improving preprocessing speed while retaining batched-input behavior.

  • 🧹 Updated documentation and package version
    Inference and validation documentation now reflects the corrected model-state behavior, and the package version is bumped to 8.4.140.

🎯 Purpose & Impact
  • Grayscale TIFF training jobs should run successfully instead of failing because of an image/model channel mismatch.
  • 🛡️ Models are less likely to be unexpectedly altered by prediction, validation, calibration, export, or precision changes.
  • 🏋️ Training and tuning become more faithful to the model the user actually loaded, including in-memory edits and custom weights.
  • 🌐 Multi-GPU training is more consistent with single-GPU training, including support for custom callbacks and prepared model state.
  • 📊 Small dataset experiments become more robust, especially when using fractional sampling.
  • Single-image inference receives a modest preprocessing speed improvement.
  • 🔄 Users working with YOLO26, multispectral data, TIFF datasets, model export, or DDP training are likely to see the greatest benefits from this release.
What's Changed

Full Changelog: https://github.com/ultralytics/ultralytics/compare/v8.4.139...v8.4.140

View original

Upgraded? How did it go?

Discussion