-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Position embedding in the DETR model #19833
Comments
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Hey @NielsRogge , could you explain how to solve this issue? You just put the Goo first issue label on it but it's not clear what a contributor would have to do to fix it. |
Hi @NielsRogge, I would like to take on this. |
Yeah I marked this as good first issue as someone could take a deeper dive into DETR's position embeddings. Reading the paper for that could definitely be helpful. But the implementation is correct, it's probably internal variables/docstrings that need to be updated. From the paper:
So the Then a bit later on in the paper they state:
So the So we could for clarity update the "position_embeddings" argument to "object_queries", and the "key_value_position_embeddings" argument to "spatial_position_embeddings" |
Hello @daspartho @NielsRogge , wanted to inquire as to whether any progress was made on this? I'd like to take a look. |
Hello @NielsRogge , I am currently working on this issue. I've read the article and I do understand what has to be changed. My question is if we only have to change the I did some local tests too, and noted that changing only in the function forward i mentioned to I looked up some tests, but I do think the problem is in the code itself, since classes related to that one would be passing arguments wrongly. This is my first contribution to an open source project this size, and I'm really happy to do it. Thanks in advance. |
Hey @NielsRogge is this issue still open? If yes can I take this? |
Hey @hackpk I'm finishing touches in my PR to fix this Issue, so Idk... |
That's great.I'll look for another issue then. Thanks. |
No problem, good luck :D |
@NielsRogge @amyeroberts I think this can be closed due to #24652 |
System Info
According to the argument definition of the
DetrDecoderLayer.forward()
specified here:transformers/src/transformers/models/detr/modeling_detr.py
Lines 723 to 728 in bd469c4
The
positional_embeddings
argument for the cross-attention should be assigned by theposition_embeddings
variable instead ofquery_position_embeddings
.transformers/src/transformers/models/detr/modeling_detr.py
Lines 757 to 764 in bd469c4
Is this an error in the argument definition or the code part?
Thank you!
Who can help?
@NielsRogge
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
It is from the transformers code.
Arguments definition:
transformers/src/transformers/models/detr/modeling_detr.py
Lines 723 to 728 in bd469c4
Cross-attention code:
transformers/src/transformers/models/detr/modeling_detr.py
Lines 757 to 764 in bd469c4
Expected behavior
Either:
positional_embeddings
argument for the cross-attention should be assigned by theposition_embeddings
variable instead ofquery_position_embeddings
, orThe text was updated successfully, but these errors were encountered: