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

Add SWAG Vision Transformer Weight #5714

Merged
merged 13 commits into from
Apr 1, 2022
Merged

Add SWAG Vision Transformer Weight #5714

merged 13 commits into from
Apr 1, 2022

Conversation

YosuaMichael
Copy link
Contributor

@YosuaMichael YosuaMichael commented Mar 31, 2022

subtask of #5708

Adding weight of ViT_B_16 and ViT_L_16 model from https://github.com/facebookresearch/SWAG

@facebook-github-bot
Copy link

facebook-github-bot commented Mar 31, 2022

💊 CI failures summary and remediations

As of commit c36a3ec (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



🚧 2 ongoing upstream failures:

These were probably caused by upstream breakages that are not fixed yet.


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@YosuaMichael YosuaMichael marked this pull request as draft March 31, 2022 13:48
@YosuaMichael YosuaMichael self-assigned this Mar 31, 2022
Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

Thanks @YosuaMichael. I've added a couple of comments but overall I like your approach:

torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Show resolved Hide resolved
torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Show resolved Hide resolved
torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Outdated Show resolved Hide resolved
torchvision/models/vision_transformer.py Show resolved Hide resolved
@YosuaMichael YosuaMichael marked this pull request as ready for review April 1, 2022 09:06
@YosuaMichael YosuaMichael changed the title Add SWAG Weight Add SWAG Vision Transformer Weight Apr 1, 2022
Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

Looking good. Could you provide also the commands that you used to verify the model along with their output? Something similar to #5450 (comment) (note that the commands will be slightly different because the Multi-weight support API is out of prototype).

README.rst Outdated Show resolved Hide resolved
Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
@YosuaMichael
Copy link
Contributor Author

YosuaMichael commented Apr 1, 2022

@datumbox here is the command I used for testing the vit_b_16_swag model:

python -u ~/script/run_with_submitit.py --timeout 3000 --ngpus 1 --nodes 1 --partition train --model vit_b_16 --data-path="/datasets01_ontap/imagenet_full_size/061417" --test-only --batch-size=1 --weights="ViT_B_16_Weights.IMAGENET1K_SWAG_V1"
Acc@1 85.304 Acc@5 97.650

And here for vit_l_16_swag model:

python -u ~/script/run_with_submitit.py --timeout 3000 --ngpus 1 --nodes 1 --partition train --model vit_l_16 --data-path="/datasets01_ontap/imagenet_full_size/061417" --test-only --batch-size=1 --weights="ViT_L_16_Weights.IMAGENET1K_SWAG_V1"
Acc@1 88.064 Acc@5 98.512

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

Thanks a lot of the changes @YosuaMichael, everything looks good to me.

@mannatsingh Could you have also a look to let us know if all look good to you?

Copy link

@mannatsingh mannatsingh left a comment

Choose a reason for hiding this comment

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

Everything looks perfect, thanks @YosuaMichael !

@datumbox
Copy link
Contributor

datumbox commented Apr 1, 2022

The failures are unrelated. cc @pmeier

@YosuaMichael you are good to merge.

@YosuaMichael YosuaMichael merged commit 781b0f9 into main Apr 1, 2022
@datumbox datumbox deleted the add-swag-weight branch April 1, 2022 16:09
@datumbox datumbox mentioned this pull request Apr 1, 2022
24 tasks
@datumbox datumbox linked an issue Apr 1, 2022 that may be closed by this pull request
facebook-github-bot pushed a commit that referenced this pull request Apr 6, 2022
Summary:
* Add vit_b_16_swag

* Better handling idiom for image_size, edit test_extended_model to handle case where number of param differ from default due to different image size input

* Update the accuracy to the experiment result on torchvision model

* Fix typo missing underscore

* raise exception instead of torch._assert, add back publication year (accidentally deleted)

* Add license information on meta and readme

* Improve wording and fix typo for pretrained model license in readme

* Add vit_l_16 weight

* Update README.rst

* Update the accuracy meta on vit_l_16_swag model to result from our experiment

Reviewed By: NicolasHug

Differential Revision: D35393156

fbshipit-source-id: d8e38f783c3c881cf8a8ce21d05a33671818be53

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the SWAG pre-trained weights in TorchVision
4 participants