Skip to content
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

RuntimeError: Error(s) in loading state_dict for BaseVideoModel: size mismatch for head.out.weight: copying a param with shape torch.Size([400, 768]) from checkpoint, the shape in current model is torch.Size([5, 768]). size mismatch for head.out.bias: copying a param with shape torch.Size([400]) from checkpoint, the shape in current model is torch.Size([5]). #24

Open
lyxlplhy opened this issue May 9, 2024 · 1 comment

Comments

@lyxlplhy
Copy link

lyxlplhy commented May 9, 2024

Hello, I encountered this error while using CHECKPOINT-FILE-PATH: "/yxli/mma/TADAConv main/TADAConv main/tadconvnextv2ttiny-in1k_k400_79.6. pyth" to load my own dataset with pre trained weights. RuntimeError: Error (s) in loading stateudict for BaseVideoModel:
Size mismatch for head.out.weight: copying a param with shape torch Size ([400, 768]) from checkpoint, the shape in current model is torch Size ([5, 768])
Size mismatch for head.out.bias: copying a param with shape torch Size ([400]) from checkpoint, the shape in current model is torch Size ([5])

@lyxlplhy
Copy link
Author

lyxlplhy commented May 9, 2024

I have resolved it.
Add two lines of code before the code in/TAdaConv main/tadconv/utils/checkpoint. py: mismatch=ms. load_sate_dict (checkpoint ["model_state"], strict=False):
Del checkpoint ["model_state"] ["head. out. weight"]
Del checkpoint ["model_state"] ["head. out. bias"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant