-
Notifications
You must be signed in to change notification settings - Fork 7
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
Using HuggingFace ViT implementation (#219) #303
Conversation
@@ -119,6 +144,7 @@ def __init__(self, **kwargs: Any) -> None: | |||
num_heads=12, | |||
hidden_dim=768, | |||
mlp_dim=3072, | |||
pretrained_name="google/vit-base-patch16-224", |
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.
why still pass the other arguments? they aren't used, right? or is this a requirement for reloading the model?
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.
Point.
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.
Ok, I thought the idea was to reload it without pretrained_name
. Now, it will not be able to reloaded since pretrained_name
is missing? Can we maybe add a test for this model or do we already have that?
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.
model_fn
loads through from_state_dict
if model_state_url
is specified. So reloading (in principle) should be able to restore the weights.
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.
What would a test for this do?
prediction_strategy: Optional[PredictionStrategy] = None, | ||
add_icarl_class_means: bool = True, | ||
pretrained_name: Optional[str] = None, |
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.
maybe make this the first argument?
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.
Done
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)src/renate/benchmark/models/vision_transformer.py
|
Solves #219
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.