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
RuntimeError: Error(s) in loading state_dict for VisionTransformer:
Missing key(s) in state_dict: "heads.head.weight", "heads.head.bias".
Unexpected key(s) in state_dict: "heads.weight", "heads.bias".
The heads format of transfer learning ViT model is different from the original ViT model: the original ViT model has Sequential heads and Linear head.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
lesson 268: https://www.udemy.com/course/pytorch-for-deep-learning/learn/lecture/34049500#questions
RuntimeError: Error(s) in loading state_dict for VisionTransformer:
Missing key(s) in state_dict: "heads.head.weight", "heads.head.bias".
Unexpected key(s) in state_dict: "heads.weight", "heads.bias".
The heads format of transfer learning ViT model is different from the original ViT model:
the original ViT model has Sequential heads and Linear head.
ViT model after transfer learning
Original ViT model
how to format the ViT heads after transfer learning so that it can be saved and loaded properly?
Beta Was this translation helpful? Give feedback.
All reactions