Sync develop branch to main - #154
Open
asgersvenning wants to merge 48 commits into
Open
Conversation
… TensorPredictions.plot
…king change in 8.3.125
…avoid memory-leak and OOM on large images
…at-bug into develop
…DME for CPU/CUDA compatible installation via uv/pip/source
- Bump ultralytics upper bound to 8.4.49 (required for YOLOv26) - Update postprocess() in yolo_helpers.py to handle the end2end output format introduced by YOLOv26 (post-NMS xyxy detections vs legacy pre-NMS xywh anchors); also handle the 8.4.x tuple output wrapping for legacy YOLO11 models - Fix trainers.py to use load_checkpoint (ultralytics >= 8.4 renamed attempt_load_one_weight) and yaml_load (replaced by YAML.load) - Add scripts/training/fb_config_yolo26n.yaml for training with yolo26n-seg Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the internal-API hack (pred.setup_model(self=pred, ...)) with direct access to yolo.model. The setup_model call in ultralytics 8.4 now requires args.end2end which the dict2attr stub did not provide. For .pt models the AutoBackend wrapper is unnecessary since flat-bug preprocesses images itself and only uses PyTorch tensors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- fb_train.py: change default model from yolov8m-seg.pt to yolo26m-seg.pt - fb_config_M40S.yaml: update to yolo26m-seg.pt - fb_config_M40S_GHPC.yaml: fix yolov26m.pt (wrong name/variant) to yolo26m-seg.pt Pretrained weights are auto-downloaded by ultralytics if not present locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ultralytics < 8.4 does not call attempt_download_asset inside torch_safe_load, so yolo26m-seg.pt (and any other asset-list model) was never downloaded on machines running 8.3.x. Add an explicit attempt_download_asset call in setup_model before _load_checkpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
YOLOv26's one2many loss uses significantly more memory during validation than YOLOv8 did. Call torch.cuda.empty_cache() before each validation pass to release fragmented reserved memory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ultralytics doubles batch_size for validation (non-OBB tasks), but YOLOv26's one2many loss makes this OOM on memory-constrained GPUs. Clamp validation batch_size back to self.args.batch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Default compression level 6 is slow for large batches of crops. Level 1 is significantly faster at the cost of slightly larger files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
YOLOv26's one2many head assigns many positive anchors per GT instance. On dense flat-bug images (hundreds of insects per 1024×1024 crop) this causes single_mask_loss/crop_mask to materialise a [n_pos, 256, 256] float32 tensor of ~11.5 GB — OOM even at batch_size=1. The validation loss is only logged and has no effect on fitness, mAP, or early stopping. We therefore replace model.loss (on both the live model and the EMA model) with a no-op returning zeros for the duration of each validation pass, then restore the class method via del. This is orthogonal to the earlier batch_size and empty_cache mitigations, which did not address the per-image root cause. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
YOLOv26's validator initialises self.loss with 5 components; our no-op was returning torch.zeros(4) from len(self.loss_names). Return scalar 0 instead — adding a scalar to any tensor is always valid. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Feature/yolov26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We should probably sync the develop branch with main soon, since it has now been in use for some time, without any major issues cropping up as far as I'm aware.
There are a bunch of improvements in the develop version which it would be great to push to the main version, including:
flat-bugpublished on PyPi: https://pypi.org/project/flat-bug/But perhaps there are a few issues it would be nice to address first, though they could also be part of a future update:
TIME=True/--verbosedoesn't work on CPU since it is hard-coded to rely ontorch.cuda.Event.