openmedlab/MedLSAM

Pretraining checkpoint

Opened this issue · 1 comments

After i trained,i put the .tar at vit_load_path.But i get the missing key error when i want to segment other data(like this:Missing key(s) in state_dict: "image_encoder.pos_embed", "image_encoder.patch_embed.proj.weight").Did i forget anything to do?thanks.

After i trained,i put the .tar at vit_load_path.But i get the missing key error when i want to segment other data(like this:Missing key(s) in state_dict: "image_encoder.pos_embed", "image_encoder.patch_embed.proj.weight").Did i forget anything to do?thanks.
Sorry for the late reply. It seems like you need to extract the medlam weight from tar checkpoint and save it as pth. Then place them at medlam_load_path rather than the vit_load_path. I add a script python train/extract_weights.py -p train/checkpoint/your.tar to do this (change the tar path to your file). It will automatically extract the network weights from the checkpoint and save them as checkpoint/medlam.pth.