You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
Here, we're looking for keys that start with backbone or head, and then erasing them.
The problem is that we are not only erasing the first one, but all instances.
I had a model with an auxiliary head, named aux_head so this happened:
head.aux_head.weight → aux_weight
We should use k.replace('backbone.', 1) and k.replace('head.', 1) to make sure we only replace the first appearance.
model_preparation_algorithm/mpa/modules/models/classifiers/sam_classifier.py
Lines 106 to 137 in 55af1ed
Here, we're looking for keys that start with
backbone
orhead
, and then erasing them.The problem is that we are not only erasing the first one, but all instances.
I had a model with an auxiliary head, named
aux_head
so this happened:head.aux_head.weight
→aux_weight
We should use
k.replace('backbone.', 1)
andk.replace('head.', 1)
to make sure we only replace the first appearance.If at some point we update to Python 3.9 we could even use
k = k.remove_prefix('backbone.')
.The text was updated successfully, but these errors were encountered: