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

selected index k out of range #23

Open
tahirashehzadi opened this issue Jul 15, 2024 · 3 comments
Open

selected index k out of range #23

tahirashehzadi opened this issue Jul 15, 2024 · 3 comments
Labels
question Further information is requested

Comments

@tahirashehzadi
Copy link

Question

Hi,

I encountered an error while training the model on a custom dataset:

select_tgt_index = torch.topk(mc_score, self.topk_sa, dim=1)[1]
RuntimeError: selected index k out of range

Additional

No response

@tahirashehzadi tahirashehzadi added the question Further information is requested label Jul 15, 2024
@xiuqhou
Copy link
Owner

xiuqhou commented Jul 16, 2024

Hello @tahirashehzadi
This is because the input image is too small and there are not enough queries to select top_sa. We use (800,1333) as the default input shape, and topk_sa=300. Did you change the input shape and "topk_sa"?

@xiuqhou
Copy link
Owner

xiuqhou commented Jul 16, 2024

You can try to increase the input shape (see transforms/presets.py), or decrease topk_sa of SalienceTransformerEncoderLayer.

@Kunghaoyu
Copy link

topk_sa

我也遇到了这个问题,但是我现在跑的是DOTA那个遥感数据集,里面目标挺多的,不应该是你说的这个情形。训练的时候,我没做裁剪,是不是图像太大了也会出现这种情况?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants