Skip to content

fix: install rfdetr train extras in RF-DETR finetuning notebooks - #447

Merged
asfandiyar-rf merged 1 commit into
mainfrom
fix/rf-detr-train-extras
Jul 15, 2026
Merged

fix: install rfdetr train extras in RF-DETR finetuning notebooks#447
asfandiyar-rf merged 1 commit into
mainfrom
fix/rf-detr-train-extras

Conversation

@asfandiyar-rf

Copy link
Copy Markdown
Contributor

Problem

On a fresh Colab run, the training cell in both RF-DETR finetuning notebooks fails:

ImportError: RF-DETR training dependencies are missing. Install them with `pip install "rfdetr[train,loggers]"` and try again.

Two causes:

  1. Newer rfdetr releases (current: 1.8.3) moved training dependencies (pytorch_lightning, torchmetrics, pycocotools, etc.) into the optional [train] extra, so the plain rfdetr install can no longer train.
  2. The existing install line !pip install -q rfdetr>=1.4.0 ... is unquoted, so the shell treats >=1.4.0 as an output redirect — the version constraint was never actually applied and Colab always pulled the latest release.

Fix

!pip install -q "rfdetr[train,loggers]>=1.4.0" roboflow "supervision==0.29.1"
  • [train] restores the training dependencies; [loggers] matches the package's own error message and keeps default TensorBoard logging working outside Colab.
  • Quoting makes the >=1.4.0 floor actually apply.
  • supervision is pinned to 0.29.1, following the pattern in the newer rf-detr-keypoint-detection.ipynb, to prevent the same class of drift from the annotator API.

Notebooks changed

  • notebooks/how-to-finetune-rf-detr-on-detection-dataset.ipynb
  • notebooks/how-to-finetune-rf-detr-on-segmentation-dataset.ipynb

Both verified end-to-end on fresh Colab runs (training now completes).

Note: nvidia-launchables/how-to-finetune-rf-detr-on-segmentation-dataset-a100.ipynb still pins rfdetr==1.3.0 (pre-extras split, so not broken today) — left untouched since updating it would need an A100 retest.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the RF-DETR finetuning notebooks’ dependency install cells so fresh Colab runs reliably install the correct RF-DETR version and the optional training/logging dependencies needed for training.

Changes:

  • Quote the rfdetr...>=... spec so >= is not misinterpreted by the shell as redirection.
  • Install rfdetr with [train,loggers] extras to include training dependencies required by newer rfdetr releases.
  • Pin supervision to 0.29.1 to reduce notebook drift and match the pattern used elsewhere in the repo.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
notebooks/how-to-finetune-rf-detr-on-detection-dataset.ipynb Fixes dependency installation to include RF-DETR training extras and pins supervision for stable Colab runs.
notebooks/how-to-finetune-rf-detr-on-segmentation-dataset.ipynb Same dependency installation fix as detection notebook to ensure training works on fresh Colab.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@asfandiyar-rf
asfandiyar-rf merged commit 6625753 into main Jul 15, 2026
3 checks passed
@asfandiyar-rf
asfandiyar-rf deleted the fix/rf-detr-train-extras branch July 15, 2026 18:02
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.

3 participants