Can't run how-to-finetune-rf-detr-on-segmentation-dataset notebook. RuntimeError: selected index k out of range
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- jupyter-notebook, python, pytorch
- Domain
- computer-vision, machine-learning
Research direction
Reproduce the failure in the how-to-finetune-rf-detr-on-segmentation-dataset notebook using the supplied Colab example and rfdetr 1.4.3. Start at the model.train call and the lwdetr.py traceback around line 753; done means the first epoch completes without the selected-index error and the notebook remains runnable in the reported environment.
Written by the indexing model from the issue text.
Description
Search before asking
- I have searched the Roboflow Notebooks issues and found no similar bug report.
Notebook name
how-to-finetune-rf-detr-on-segmentation-dataset
Bug
When trying to execute notebook code I get an error at the end of the first epoch. No changes were made to the notebook. I'm using rfdetr 1.4.3
RuntimeError Traceback (most recent call last)
/tmp/ipython-input-515328503.py in <cell line: 0>()
3 model = RFDETRSegNano()
4
----> 5 model.train(dataset_dir=dataset.location, epochs=5, batch_size=4, grad_accum_steps=4)
7 frames
/usr/local/lib/python3.12/dist-packages/rfdetr/models/lwdetr.py in forward(self, outputs, target_sizes)
751
752 prob = out_logits.sigmoid()
--> 753 topk_values, topk_indexes = torch.topk(prob.view(out_logits.shape[0], -1), self.num_select, dim=1)
754 scores = topk_values
755 topk_boxes = topk_indexes // out_logits.shape[2]
RuntimeError: selected index k out of range
Environment
- Google colab
- T4 GPU
- CUDA 13.0
Minimal Reproducible Example
from roboflow import download_dataset
dataset = download_dataset("https://universe.roboflow.com/roboflow-jvuqo/creacks-eapny/4", "coco")
from rfdetr import RFDETRSegNano
model = RFDETRSegNano()
model.train(dataset_dir=dataset.location, epochs=5, batch_size=4, grad_accum_steps=4)
Additional
No response
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!
- Dominant language
- Jupyter Notebook
- Stars
- 9.7k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roboflow/notebooks
-
zero-shot-object-detection-with-grounding-dino.ipynb can't render correctlyPossibly taken @rkrisa claimed this 146 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Minor Issue: The notebook tutorial is using the wrong model (yolov11s instead of RF-DETR)Possibly taken @BillionClaw claimed this 241 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
All issues in roboflow/notebooks
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
roboflow/supervision#2971 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
MagneticResonanceImaging/MRIReco.jl#356 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cleanlab/cleanvision#282 ·