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

fix detr device map #27089

Merged
merged 2 commits into from
Oct 27, 2023
Merged

fix detr device map #27089

merged 2 commits into from
Oct 27, 2023

Conversation

SunMarc
Copy link
Member

@SunMarc SunMarc commented Oct 26, 2023

What does this PR do ?

This PR solves an issue that #26849 introduced. For DeformableDetrForObjectDetection and DetaForObjectDetection, we can't initialize the model on meta device as we modify the weights during the initialization.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 26, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me but let's comment as to why we do this in the code. It's one of the only model that needs this no?

@SunMarc
Copy link
Member Author

SunMarc commented Oct 27, 2023

Yes, not every ForObjectDetection models needs this. For example, the TableTransformerForObjectDetection don't modify the weights at initialization. I will add a comment.

@SunMarc SunMarc requested a review from ArthurZucker October 27, 2023 13:37
@SunMarc SunMarc merged commit 29c74f5 into huggingface:main Oct 27, 2023
3 checks passed
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
* fix detr device map

* add comments
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

Successfully merging this pull request may close these issues.

3 participants