xiaohong1 / COVID-ViT

33 stars 11 forks source link

Loading pretrained weights into the 2D and 3D models #9

Open AsmaBaccouche opened 1 year ago

AsmaBaccouche commented 1 year ago

Hello, I got this error when loading the weights with load_state_dict

RuntimeError: Error(s) in loading state_dict for ViT3: size mismatch for pos_embedding: copying a param with shape torch.Size([1, 3137, 1024]) from checkpoint, the shape in current model is torch.Size([1, 1569, 1024]).

what's wrong ? also same problem with the 2D model

eedack01 commented 1 year ago

For the 2d model I got this to work by using the efficient-save.py in the vit-pytorch folder.

I have not got the 3d version to work yet.