-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while Loading vit_small weights #26
Comments
you can try pretext_model = torch.load(r'./vit_small.pth.tar')['state_dict'] |
Do I need to use |
Hi @Xiyue-Wang , As understanding the code, it seems feature extraction should be done from base encoder only rather the complete architecture, so for that need to find a solution. Better load the complete weights and truncate the model after that. Whats your view? Thanks! |
Hi @Xiyue-Wang ,
Thank you for the amazing repo.
I am trying to load the weights for MoCoV3 vit_small pretrained weights.
model = moco.builder_infence.MoCo_ViT(partial(vits.__dict__['vit_small'], stop_grad_conv1=True))
pretext_model = torch.load('TransPath/vit_small.pth.tar')['state_dict']
model = nn.DataParallel(model).cuda()
model.load_state_dict(pretext_model,strict=False)
But facing an error as below
I checked the keys for model and weights and seems to be same, but still above error.
Looking forward.
Thanks!
The text was updated successfully, but these errors were encountered: