Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: selected index k out of range #181

Open
SHUSHENGQIGUI opened this issue Jul 26, 2023 · 4 comments
Open

RuntimeError: selected index k out of range #181

SHUSHENGQIGUI opened this issue Jul 26, 2023 · 4 comments

Comments

@SHUSHENGQIGUI
Copy link

when I input 7350X150 image for inference, or some images with high height-width ratio , it will get this bug, the bug detial is in below:
File "/GroundingDINO/groundingdino/models/GroundingDINO/transformer.py", line 278, in forward
topk_proposals = torch.topk(topk_logits, topk, dim=1)[1] # bs, nq
RuntimeError: selected index k out of range

how to fix this bug ? please

@rentainhe
Copy link
Collaborator

After the data augmentation, the image size may be too small and there may not be enough feature for selection

@SHUSHENGQIGUI
Copy link
Author

Thank you! do you know what is the minimal limit of the image size ratio?

@rentainhe
Copy link
Collaborator

Thank you! do you know what is the minimal limit of the image size ratio?

Sry we did not test some extreme situations before : (

I think Grounding-DINO works for most of the testing images

@artemisp
Copy link

Attempted a quick fix here: #346 (comment)
Feel free to try it out to help test it - or suggest a better solution. This is a really quick patch.

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

No branches or pull requests

3 participants