Closed xiaozhen228 closed 1 year ago
same question
Have you use the original implementation or have you changed the input size?
I have identified the potential cause of this error: using mismatched parameters and pre training models (such as using vit-l parameters and calling vit-h pretraining model). I have resolved it, thank you for your reply.
RuntimeError: Error(s) in loading state_dict for SAM: size mismatch for image_encoder.pos_embed: copying a param with shape torch.Size([1, 64, 64, 1024]) from checkpoint, the shape in current model is torch.Size([1, 64, 64, 1280]).
Why I have such problem when I plan to load the weights? May be the code has some problems?