Skip to content

pretrained weights from self_supervised_pretraining has extra key #575

@yiheng-wang-nv

Description

@yiheng-wang-nv

I downloaded the pretrained weights mentioned in https://github.com/Project-MONAI/tutorials/blob/master/self_supervised_pretraining/README.md and tried to use it in ssl_finetuning_train.py, but met an error:

Unexpected key(s) in state_dict: "patch_embedding.cls_token".

I compared the keys between the download weight file vitautoenc_weights.pt and the class ViTAutoEnc and found that patch_embedding.cls_token is not in the latest implementation of ViTAutoEnc network. Maybe the pretrained weight is trained in an old version of the network.

Here should the pretrained weight be updated, or the ssl_finetuning_train.py should be modified to load weights correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions