-
Notifications
You must be signed in to change notification settings - Fork 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
fix Swin Transformer inplace mutation #6266
Conversation
@YosuaMichael Do you think this fix requires a model retraining for the current released pretrained weights for Swin Transformer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ain-soph , the PR looks good!
I don't think we need to do any retraining since the model parameters layout is not changed.
Thanks for the fix @ain-soph ! The layout isn't changed, but if
I don't really know enough to know whether that case gets hit during our trainings though. |
@NicolasHug It should be okay. For each attn layer, its input size is actually fixed during training for ImageNet dataset because we resize the input images. If the And different blocks have individual |
Just to give more context for @NicolasHug, so previously when we train the models the So this PR should fix the problem on that and the training behaviour should be more similar with the one when we train the weight. |
Hey @YosuaMichael! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: * fix inplace mutation * Different attn shouldn't share the same attribute * a simpler solution Reviewed By: jdsgomes Differential Revision: D37993419 fbshipit-source-id: 2a08a62168c4e6ee6c5a2ca934de88aa04361016 Co-authored-by: YosuaMichael <yosuamichaelm@gmail.com>
Fix an issue that in previous codes,
shift_size
is modified in-place, which might modifies the attribute valueself.shift_size
as well.cc @YosuaMichael