easy_ViTPose icon indicating copy to clipboard operation
easy_ViTPose copied to clipboard

Why the offical model can not match?

Open BOTYW-0 opened this issue 1 year ago • 4 comments

When i use the wholebody model from the offical vitpose models, it seems not match. More errors like : size mismatch for backbone.blocks.9.attn.qkv.weight: copying a param with shape torch.Size([3072, 1024]) from checkpoint, the shape in current model is torch.Size([2304, 768]). size mismatch for backbone.blocks.9.attn.qkv.bias: copying a param with shape torch.Size([3072]) from checkpoint, the shape in current model is torch.Size([2304]). size mismatch for backbone.blocks.9.attn.proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([768, 768]). size mismatch for backbone.blocks.9.attn.proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]). size mismatch for backbone.blocks.9.norm2.weight: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]). size mismatch for backbone.blocks.9.norm2.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]).

BOTYW-0 avatar Jul 25 '24 11:07 BOTYW-0

Provide more informations. Are you using matching model sizes for checkpoint and model declaration?

JunkyByte avatar Jul 25 '24 11:07 JunkyByte

Provide more informations. Are you using matching model sizes for checkpoint and model declaration?

Yes, i'm sure. I downloaded model Vitpose +-L form the wholebody dataset section, and I renamed this model 'vitpose-l-wholebody.path'

BOTYW-0 avatar Jul 25 '24 12:07 BOTYW-0

The models are split into the different heads using https://github.com/JunkyByte/easy_ViTPose/blob/main/model_split.py The models provided in hugging face are taken from the original section with this process applied. Try using the model_split script (which was taken from original vitpose repo https://github.com/ViTAE-Transformer/ViTPose/blob/d5216452796c90c6bc29f5c5ec0bdba94366768a/tools/model_split.py#L4)

JunkyByte avatar Jul 25 '24 13:07 JunkyByte

Thanks for your reply! I used the official website's code segmentation model before, but it also reported an error. I downloaded another model and successfully ran it using your segmentation code.Thanks again for your answers.

The models are split into the different heads using https://github.com/JunkyByte/easy_ViTPose/blob/main/model_split.py The models provided in hugging face are taken from the original section with this process applied. Try using the model_split script (which was taken from original vitpose repo https://github.com/ViTAE-Transformer/ViTPose/blob/d5216452796c90c6bc29f5c5ec0bdba94366768a/tools/model_split.py#L4)

BOTYW-0 avatar Jul 26 '24 02:07 BOTYW-0