Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.77k stars 668 forks source link

Pretrained model not compatible with downstream training #1249

Open artony35 opened 1 year ago

artony35 commented 1 year ago

I am having some issues using a private pretrained encoder weights. When following the swin-unetr pretrain repo to train a pretrained encoder weights, the model can't be loaded for downstream segmentation training. Here is the error:

KeyError: 'module.patch_embed.proj.weight'

Is there anything that might be missing from the pretrain repo? Would it be possible to fix this issue without retraining? Thank you!!

KumoLiu commented 1 year ago

Hi @artony35, I would suggest you print both the structure of your pre-trained weights and the structure of the network to see if there is anything different. I guess it may be due to the "module.". Hi @tangy5, do you have any suggestions on how to be compatible when users load with their own pre-trained weights? Thanks in advance!