ViTPose icon indicating copy to clipboard operation
ViTPose copied to clipboard

Unexpected and Missing Keys when loading InterHand2.6M weights

Open Lag21 opened this issue 2 years ago • 2 comments

Hello,

I have been trying to use the weights provided in this issue with the configs files for InterHand2.6M. However, I get the following errors when I load the weights to the model:

The model and loaded state dict do not match exactly unexpected key in source state_dict: backbone.cls_token missing keys in source state_dict: backbone.last_norm.weight, backbone.last_norm.bias

For this specific example, I'm using ViTPose_small_interhand2d_all_256x192.py and vitpose_small_hand.pth

Any help will be appreciated. Thank you.

Lag21 avatar Mar 17 '23 17:03 Lag21

@Annbless

epleone avatar Dec 27 '23 11:12 epleone

The model and loaded state dict do not match exactly unexpected key in source state_dict: backbone.cls_token

Just do state_dict.pop('backbone.cls_token')

missing keys in source state_dict: backbone.last_norm.weight, backbone.last_norm.bias

Pass last_norm=False to ViT. I tested all models, just small and base need set last_norm=False.

cpunion avatar Apr 26 '24 03:04 cpunion