IDEA-Research / detrex

detrex is a research platform for DETR-based object detection, segmentation, pose estimation and other visual recognition tasks.
https://detrex.readthedocs.io/en/latest/
Apache License 2.0
1.97k stars 206 forks source link

Potential problem of GroupConditionalSelfAttention #163

Closed xyupeng closed 1 year ago

xyupeng commented 1 year ago

Hi there,

I see the implementation of GroupConditionalSelfAttention and find that it may have some problems. https://github.com/IDEA-Research/detrex/blob/75318d139157ea2dbf0b3100a3dc3623d9740878/projects/group_detr/modeling/attention.py#L143-L158 In line 154-158, qkv are reshaped to N=num_groups * num_queries_per_group. In this way, all queries in all groups interact with each other, rather than interacting within each group. Is this implementation a potential mistake? Or I misunderstand something?

SlongLiu commented 1 year ago

Thanks for your issues.

Thanks to the suggestions of @charlesCXK (the author of group-detr), we find it is a bug in our implementations. We will fix it in our next version.

rentainhe commented 1 year ago

I'm closing this issue~ we will try to correct the potential bug after Group-DETR full release, and feel free to reopen this issue if needed~