Skip to content

Update rfdetr requirement from <2,>=1.6.0 to >=1.7.1,<2 - #37

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/main/rfdetr-gte-1.7.1-and-lt-2
Closed

Update rfdetr requirement from <2,>=1.6.0 to >=1.7.1,<2#37
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/main/rfdetr-gte-1.7.1-and-lt-2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jun 4, 2026

Copy link
Copy Markdown
Contributor

Updates the requirements on rfdetr to permit the latest version.

Release notes

Sourced from rfdetr's releases.

RF-DETR 1.7.1: Stability fixes (BF16 train & ckpt loading)

Summary

RF-DETR 1.7.1 is a focused patch release that fixes three bugs affecting common workflows. If you train segmentation models with BF16 mixed-precision, load official starter checkpoints with from_checkpoint, or run RF-DETR alongside NumPy 2.x, this release resolves crashes you may have hit.

What's fixed

  • BF16 mixed-precision segmentation training crash. Training a segmentation model with BF16 mixed-precision (e.g. amp_dtype="bfloat16") could fail with a dtype mismatch error in fused AdamW. The root cause was a low-level convolution backward pass converting a gradient to reduced precision before it reached the optimizer. Gradients now stay in the correct dtype throughout, matching standard PyTorch behaviour. (#1076)

  • RFDETR.from_checkpoint failing on official starter checkpoints. Loading official Roboflow starter weights with RFDETR.from_checkpoint(...) raised ValueError: Could not infer model class. The checkpoint metadata stores pretrain_weights="none" as a sentinel value, which the loader didn't handle. It now falls back to inferring the model variant from the checkpoint filename and logs which variant it detected. (#1065)

  • NumPy 2.x import crash. import rfdetr raised AttributeError: module 'numpy' has no attribute 'complex_' when NumPy 2.0 or later was installed alongside an older transitive dependency (such as chumpy or older TensorFlow builds) that still references the removed np.complex_ alias. A compatibility shim at import time resolves this without requiring any changes to your environment. (#1064)


Contributors

New contributor to this release — welcome!

  • Omkar Kabde (@​omkar-334) — TFLite test reliability improvements
  • Jirka Borovec (@​Borda) — BF16 segmentation fix, release

Full changelog: roboflow/rf-detr@1.7.0...1.7.1

Changelog

Sourced from rfdetr's changelog.

[1.7.1] — 2026-05-28

Fixed

  • Fixed RFDETR.from_checkpoint failing when loading a starter-style checkpoint with pretrain_weights unset or set to a sentinel value: the model variant is now inferred from the checkpoint filename as a fallback. (#1065)
  • Fixed segmentation backward pass in BF16 mixed-precision (bf16-mixed AMP): grad_input now stays in fp32 (matching standard F.conv2d backward behaviour) instead of being cast to the activation dtype, preventing a params, grads, exp_avgs, and exp_avg_sqs must have same dtype crash in fused AdamW during mixed-precision training. (#1076)
  • Fixed import rfdetr failing on NumPy 2.x when a transitive dependency references the removed np.complex_ alias. (#1064)

[1.7.0] — 2026-04-29

Added

  • augmentation_backend field on TrainConfig ("cpu" / "auto" / "gpu"): opt-in GPU-side augmentation via Kornia applied in RFDETRDataModule.on_after_batch_transfer after the batch is resident on the GPU. CPU path is unchanged and remains the default. Install with pip install 'rfdetr[kornia]'. Supports detection and segmentation (see below). (#1003)
  • Kornia GPU augmentation now supports instance segmentation: images, boxes, and per-instance masks are augmented in sync on the GPU. New public helper collate_masks packs [N_i, H, W] boolean masks into a [B, N_max, H, W] float32 tensor for Kornia; build_kornia_pipeline gains a with_masks: bool = False parameter; unpack_boxes gains an optional masks_aug tensor that re-binarises and filters masks in sync with boxes. Previously augmentation_backend="gpu"/"auto" was silently ignored for segmentation models; now it works identically to detection. Note: the mask buffer is [B, N_max, H, W] float32 — approximately 500 MB at B=8, N_max=50, H=W=560; use augmentation_backend="cpu" on cards with limited VRAM. (#1003, closes #997)
  • BuilderArgs — a @runtime_checkable typing.Protocol documenting the minimum attribute set consumed by build_model(), build_backbone(), build_transformer(), and build_criterion_and_postprocessors(). Enables static type-checker support for custom builder integrations. Exported from rfdetr.models. (#841)
  • build_model_from_config(model_config, train_config=None, defaults=MODEL_DEFAULTS) — config-native alternative to build_model(build_namespace(mc, tc)); accepts Pydantic config objects directly and constructs the internal namespace automatically. Exported from rfdetr.models. (#845)
  • build_criterion_from_config(model_config, train_config, defaults=MODEL_DEFAULTS) — config-native alternative to build_criterion_and_postprocessors(build_namespace(mc, tc)); returns a (SetCriterion, PostProcess) tuple. Exported from rfdetr.models. (#845)
  • ModelDefaults dataclass — exposes the 35 hardcoded architectural constants previously buried inside build_namespace(). Pass a dataclasses.replace(MODEL_DEFAULTS, ...) override to the new config-native builders to customise individual constants. Note: fields may be promoted to ModelConfig/TrainConfig in future phases. Exported from rfdetr.models. (#845)
  • MODEL_DEFAULTS — the canonical ModelDefaults singleton with production defaults. Exported from rfdetr.models. (#845)
  • RFDETR.predict(include_source_image=...) — opt-out flag (default True) to skip storing the source image in detections.metadata["source_image"]; set to False to reduce memory use when the image is not needed for annotation. (#912)
  • model_name is now stored in checkpoint files during training so that RFDETR.from_checkpoint() can resolve the correct model class directly from the checkpoint, without requiring the caller to know or pass a class hint. strip_checkpoint() preserves this key. Backward-compatible: checkpoints without model_name continue to resolve via pretrain_weights filename matching. (#895)
  • rfdetr_version is now stored in checkpoint files during training for provenance tracking and compatibility hints. strip_checkpoint() preserves this key. The key is omitted gracefully when the package version cannot be resolved (e.g. editable install without metadata). Backward-compatible: checkpoints without rfdetr_version continue to load normally. (#918)
  • notes parameter on RFDETR.train() and RFDETR.export() — embed arbitrary JSON-serialisable provenance metadata (labeller, date, class names, etc.) into best-model .pth checkpoints (under checkpoint["args"]["notes"]) and ONNX files (under the "rfdetr_notes" metadata property). String values are stored verbatim; all other types are JSON-encoded. (#1025, closes #1021)
  • RF_HOME environment variable controls where pretrained model weights are cached (default: ~/.roboflow/models). Bare filenames passed as pretrain_weights (e.g. "rf-detr-base.pth") are now resolved relative to this directory; paths with a directory component are used as-is with parent directories created automatically. (#130)
  • Grayscale and multispectral imagery support: RF-DETR models now accept inputs with any number of channels (not just 3). The pretrained DINOv2 patch-embedding weights are automatically adapted to the specified channel count at model construction time — no additional dependencies required. (#180, closes #75)
  • Training configuration is now saved to training_config.json in the output directory after training completes. The file captures the full TrainConfig, ModelConfig, effective training parameters, class names, and number of classes — useful for reproducibility and debugging predictions from older checkpoints. (#194)
  • dinov2_registers_windowed_small backbone is now available as a config option in ModelConfig.encoder. (#236)
  • rfdetr.from_checkpoint(path) — new top-level convenience function that loads a checkpoint and infers the correct model subclass automatically, without requiring the caller to specify a class. Equivalent to RFDETR.from_checkpoint(path) but importable directly from the rfdetr package. (#664)
  • ONNX export filenames now include the model variant name (e.g. rfdetr-medium.onnx) instead of the generic inference_model.onnx. Exporting multiple variants to the same directory no longer overwrites previous exports. (#910)
  • Background images (images without a matching label file) are now included in YOLO detection datasets as empty-detection samples instead of being silently dropped. Both detection and segmentation paths now use _LazyYoloDetectionDataset for consistent behaviour. (#915)
  • TFLite export via model.export(format="tflite"). Converts through ONNX using onnx2tf; FP32 and FP16 outputs are always produced, INT8 quantization is available with a calibration image directory: model.export(format="tflite", quantization="int8", calibration_data="path/to/images/"). Requires pip install 'rfdetr[onnx,tflite]'. (#920)
  • PyTorch Lightning .ckpt files are now accepted as pretrain_weights. Keys are automatically normalized from PTL format (state_dict with model.-prefixed keys, hyper_parametersargs) so that load_pretrain_weights, class-name extraction, and compatibility checks work without manual conversion. (#951)
  • skip_best_epochs parameter for RFDETR.train() and TrainConfig: the first N epochs are excluded from best-checkpoint selection and early-stopping comparison, preventing strong pretrained weights or resumed checkpoints from locking in a suboptimal early score. (#1000, closes #789)
  • TFLite inference now decodes segmentation mask outputs into sv.Detections.mask. Mask logits are upsampled to the source image size using Pillow bilinear resampling and thresholded at zero, matching the behaviour of PostProcess.forward. The mask tensor is detected by output name ("masks" substring) with a rank-4 shape fallback. (#1053)
  • PretrainWeightsCompatibilityWarning — new warning class emitted when a ModelConfig override (e.g. custom encoder, num_queries, or num_feature_levels) risks breaking pretrained weight loading. Importable as from rfdetr.config import PretrainWeightsCompatibilityWarning for targeted filtering. (#1017)

Changed

  • peft is no longer installed as part of the default rfdetr package. It has moved to the [lora] and [train] optional extras. If you use LoRA fine-tuning, install with pip install 'rfdetr[lora]'. (#838)
  • Native RLE annotation support in the COCO segmentation pipeline: convert_coco_poly_to_mask now explicitly detects and decodes both compressed (string counts) and uncompressed (int-list counts) RLE formats alongside existing polygon support. Malformed annotations now raise instead of being silently swallowed. (#897)
  • Pinned PyTorch Lightning to exclude known-compromised versions. (#1020)

Deprecated

  • build_namespace(model_config, train_config) — no longer used internally and deprecated in this release; use build_model_from_config, build_criterion_from_config, or _namespace_from_configs directly. It will be removed in v1.9 and currently emits a DeprecationWarning on use. (#845)
  • load_pretrain_weights(nn_model, model_config, train_config) — the train_config positional argument is deprecated and will be removed in v1.9; it is no longer used internally. Omit it: load_pretrain_weights(nn_model, model_config). Passing a non-None value emits a DeprecationWarning. (#845)
  • TrainConfig.group_detr (architecture decision → ModelConfig), TrainConfig.ia_bce_loss (loss type tied to architecture family → ModelConfig), TrainConfig.segmentation_head (architecture flag → ModelConfig), TrainConfig.num_select (postprocessor count → ModelConfig; SegmentationTrainConfig users: remove the num_select override — the model config value is always used), ModelConfig.cls_loss_coef (training hyperparameter → TrainConfig) — each now emits DeprecationWarning when set on the wrong config object and will be removed in v1.9. (#841)
  • RFDETRBase — use RFDETRNano, RFDETRSmall, RFDETRMedium, or RFDETRLarge instead. Emits FutureWarning on instantiation; scheduled for removal in v2.0. (#900)

... (truncated)

Commits
  • 6e1620e releasing 1.7.1
  • 47f668e fix(training): make _use_fused_optimizer doctest HW-deterministic (#1081)
  • b4e318f test(datasets): add output-size regression tests (#1077)
  • e67a858 fix(segm): keep grad_input fp32 in bf16-mixed AMP backward (#1076)
  • 384ef5e tests: add regression and integrity checks for benchmark download helpers (#1...
  • 2c63211 test(tflite): mask ai_edge_litert in the interpreter mock fixture (#1069)
  • 20c7e1f Handle starter checkpoints in RFDETR.from_checkpoint when `pretrain_weights...
  • fc3e968 Add NumPy 2.x np.complex_ compatibility shim in package init (#1064)
  • bbcfc75 rolling to the future 1.8.0.dev
  • e77de66 releasing 1.7.0 (#1010)
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [rfdetr](https://github.com/roboflow/rf-detr) to permit the latest version.
- [Release notes](https://github.com/roboflow/rf-detr/releases)
- [Changelog](https://github.com/roboflow/rf-detr/blob/1.7.1/CHANGELOG.md)
- [Commits](roboflow/rf-detr@1.6.0...1.7.1)

---
updated-dependencies:
- dependency-name: rfdetr
  dependency-version: 1.7.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot @github

dependabot Bot commented on behalf of github Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: dependencies. Please create it before Dependabot can add it to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@dependabot @github

dependabot Bot commented on behalf of github Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #38.

@dependabot dependabot Bot closed this Jun 17, 2026
@dependabot
dependabot Bot deleted the dependabot/pip/main/rfdetr-gte-1.7.1-and-lt-2 branch June 17, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants