xiuqhou / Salience-DETR

[CVPR 2024] Official implementation of the paper "Salience DETR: Enhancing Detection Transformer with Hierarchical Salience Filtering Refinement"
https://arxiv.org/abs/2403.16131
Apache License 2.0
105 stars 7 forks source link

selected index k out of range #23

Open tahirashehzadi opened 1 month ago

tahirashehzadi commented 1 month ago

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

xiuqhou commented 1 month ago

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 commented 1 month ago

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