Skip to content

Can't run how-to-finetune-rf-detr-on-segmentation-dataset notebook. RuntimeError: selected index k out of range #426

@montgomery-finn

Description

@montgomery-finn

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

Image

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions