-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Using A hugging face model/weights in Timm #1879
Replies: 1 comment · 3 replies
-
augreg_in21k is better than the HF transformers weighs you posted above, they are from the 'How to Train Your ViT' paper. timm did have the same weights as |
Beta Was this translation helpful? Give feedback.
All reactions
-
@rwightman also a dumb question the timm/vit_large_patch16_224.augreg_in21k are supposed to have very bad performance on in_1k right? if they are not ft on in_1k and we directly test it on 1_k adding the relevant head |
Beta Was this translation helpful? Give feedback.
All reactions
-
hello @rwightman actually there is difference in layers b/w the google/vit-large-patch16-224 and timm/vit-large-patch16-224. not only are the layer names different, the number of layers are also different.
the google model has 392 layers whereas the timm model has 296 layers |
Beta Was this translation helpful? Give feedback.
All reactions
-
The weights are not compatible as the code is different, but it's possible to remap the state dict keys to load one in the other, The google/vit-large-patch16-224 were originally adapted from the initial timm ports of the first set of Google vit weights, see https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/convert_vit_timm_to_pytorch.py ... you could reverse that mapping to go from transformers -> timm And yeah, the 21k classifier would not work well for imagenet-1k (assuming you filtered out just the imagenet-1k classes) EDIT: the # of layers differs because transformers did q, k, v as separate layers and timm merged them into one qkv |
Beta Was this translation helpful? Give feedback.
-
Hi i want to use the following model weights in timm but they are not available. how can I use these in timm? any ideas?
A similar model in timm in pretrained on in21k ft and uses augreg:timm/vit_large_patch16_224.augreg_in21k . even though its a vit large it doesn't have the same layers. Please help me thanks
Beta Was this translation helpful? Give feedback.
All reactions