Skip to content

Add Debenedetti2022Light and support for timm#100

Merged
dedeswim merged 4 commits intomasterfrom
timm
Sep 28, 2022
Merged

Add Debenedetti2022Light and support for timm#100
dedeswim merged 4 commits intomasterfrom
timm

Conversation

@dedeswim
Copy link
Member

This PR adds support for timm models and the models from A Light Recipe to Train Robust Vision Transformers as an example of timm models.

Support for timm is integrated in the following way:

  • We use timm's models registry mechanism to register the functions which generate the models
  • For the models registered in this way, we must associate an URL to download the model from. This URL is ideally a file uploaded to a GitHub release of our repo. E.g. here. The URL can be pre-determined even if the release does not exist yet, as long as the release tag is already known. This removes the burden of uploading the models to Google Drive which can be unreliable.
  • When we call load_model, the user must pass the model name used to register the model to timm's registry. Then, the function checks if the model name exists in the registry. If it exists, then it is loaded using timm.create_model (which also takes care of downloading the pre-trained checkpoint). If instead, it does not exist, it loads the model using the way which already exists.

The models I added will be uploaded as a release to the repo (which is already present as a draft here), so they will be downloadable once the PR is merged and the release is generated.

@dedeswim dedeswim requested a review from max-andr September 27, 2022 12:31
@dedeswim dedeswim mentioned this pull request Sep 27, 2022
4 tasks
@dedeswim dedeswim requested a review from fra31 September 27, 2022 12:46
Copy link
Member

@fra31 fra31 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@dedeswim dedeswim removed the request for review from max-andr September 28, 2022 12:21
@dedeswim dedeswim merged commit e11fa1d into master Sep 28, 2022
@dedeswim dedeswim deleted the timm branch October 11, 2022 08:57
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.

2 participants