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

3 hours ago

🌟 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: v8.4.139...v8.4.140

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.