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 M2TR #3

Closed
zhaoyuchen803 opened this issue Jun 29, 2022 · 1 comment
Closed

RuntimeError: Error(s) in loading state_dict for M2TR #3

zhaoyuchen803 opened this issue Jun 29, 2022 · 1 comment

Comments

@zhaoyuchen803
Copy link

We tried to load the corresponding weights for the model but found them to be inconsistent, including c23 and c40. We don't understand why, it looks like the keys are wrong.

RuntimeError: Error(s) in loading state_dict for M2TR:
Missing key(s) in state_dict: "layers.2.0.t.attention.query_embedding.weight", "layers.2.0.t.attention.query_embedding.bias", "layers.2.0.t.attention.value_embedding.weight", "layers.2.0.t.attention.value_embedding.bias", "layers.2.0.t.attention.key_embedding.weight", "layers.2.0.t.attention.key_embedding.bias", "layers.2.0.t.attention.output_linear.0.weight", "layers.2.0.t.attention.output_linear.0.bias", "layers.2.0.t.attention.output_linear.1.weight", "layers.2.0.t.attention.output_linear.1.bias", "layers.2.0.t.attention.output_linear.1.running_mean", "layers.2.0.t.attention.output_linear.1.running_var", "layers.2.0.t.feed_forward.conv.0.weight", "layers.2.0.t.feed_forward.conv.0.bias", "layers.2.0.t.feed_forward.conv.1.weight", "layers.2.0.t.feed_forward.conv.1.bias", "layers.2.0.t.feed_forward.conv.1.running_mean", "layers.2.0.t.feed_forward.conv.1.running_var", "layers.2.0.t.feed_forward.conv.3.weight", "layers.2.0.t.feed_forward.conv.3.bias", "layers.2.0.t.feed_forward.conv.4.weight", "layers.2.0.t.feed_forward.conv.4.bias", "layers.2.0.t.feed_forward.conv.4.running_mean", "layers.2.0.t.feed_forward.conv.4.running_var", "layers.2.1.filter.complex_weight", "layers.2.1.feed_forward.conv.0.weight", "layers.2.1.feed_forward.conv.0.bias", "layers.2.1.feed_forward.conv.1.weight", "layers.2.1.feed_forward.conv.1.bias", "layers.2.1.feed_forward.conv.1.running_mean", "layers.2.1.feed_forward.conv.1.running_var", "layers.2.1.feed_forward.conv.3.weight", "layers.2.1.feed_forward.conv.3.bias", "layers.2.1.feed_forward.conv.4.weight", "layers.2.1.feed_forward.conv.4.bias", "layers.2.1.feed_forward.conv.4.running_mean", "layers.2.1.feed_forward.conv.4.running_var", "layers.2.2.conv1.weight", "layers.2.2.conv1.bias", "layers.2.2.conv2.weight", "layers.2.2.conv2.bias", "layers.2.2.conv3.weight", "layers.2.2.conv3.bias", "layers.2.2.conv4.0.weight", "layers.2.2.conv4.0.bias", "layers.2.2.conv4.1.weight", "layers.2.2.conv4.1.bias", "layers.2.2.conv4.1.running_mean", "layers.2.2.conv4.1.running_var", "layers.3.0.t.attention.query_embedding.weight", "layers.3.0.t.attention.query_embedding.bias", "layers.3.0.t.attention.value_embedding.weight", "layers.3.0.t.attention.value_embedding.bias", "layers.3.0.t.attention.key_embedding.weight", "layers.3.0.t.attention.key_embedding.bias", "layers.3.0.t.attention.output_linear.0.weight", "layers.3.0.t.attention.output_linear.0.bias", "layers.3.0.t.attention.output_linear.1.weight", "layers.3.0.t.attention.output_linear.1.bias", "layers.3.0.t.attention.output_linear.1.running_mean", "layers.3.0.t.attention.output_linear.1.running_var", "layers.3.0.t.feed_forward.conv.0.weight", "layers.3.0.t.feed_forward.conv.0.bias", "layers.3.0.t.feed_forward.conv.1.weight", "layers.3.0.t.feed_forward.conv.1.bias", "layers.3.0.t.feed_forward.conv.1.running_mean", "layers.3.0.t.feed_forward.conv.1.running_var", "layers.3.0.t.feed_forward.conv.3.weight", "layers.3.0.t.feed_forward.conv.3.bias", "layers.3.0.t.feed_forward.conv.4.weight", "layers.3.0.t.feed_forward.conv.4.bias", "layers.3.0.t.feed_forward.conv.4.running_mean", "layers.3.0.t.feed_forward.conv.4.running_var", "layers.3.1.filter.complex_weight", "layers.3.1.feed_forward.conv.0.weight", "layers.3.1.feed_forward.conv.0.bias", "layers.3.1.feed_forward.conv.1.weight", "layers.3.1.feed_forward.conv.1.bias", "layers.3.1.feed_forward.conv.1.running_mean", "layers.3.1.feed_forward.conv.1.running_var", "layers.3.1.feed_forward.conv.3.weight", "layers.3.1.feed_forward.conv.3.bias", "layers.3.1.feed_forward.conv.4.weight", "layers.3.1.feed_forward.conv.4.bias", "layers.3.1.feed_forward.conv.4.running_mean", "layers.3.1.feed_forward.conv.4.running_var", "layers.3.2.conv1.weight", "layers.3.2.conv1.bias", "layers.3.2.conv2.weight", "layers.3.2.conv2.bias", "layers.3.2.conv3.weight", "layers.3.2.conv3.bias", "layers.3.2.conv4.0.weight", "layers.3.2.conv4.0.bias", "layers.3.2.conv4.1.weight", "layers.3.2.conv4.1.bias", "layers.3.2.conv4.1.running_mean", "layers.3.2.conv4.1.running_var", "classifier.projection.weight", "classifier.projection.bias".
Unexpected key(s) in state_dict: "classifier.weight", "classifier.bias".
size mismatch for model._fc.weight: copying a param with shape torch.Size([1, 1792]) from checkpoint, the shape in current model is torch.Size([2, 1792]).
size mismatch for model._fc.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([2]).

Hope this can be fixed soon.

@AllenOris
Copy link
Collaborator

Thanks for pointing out. It was a fc layer problem. We have updated M2TR checkpoints.

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

2 participants