question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Torch.size mismatch

See original GitHub issue

I want to use your best model to test a dataset named “ECSSD”, and I use the sentence you write in the Test part, download the model whose name is “run-1”,and update it in the sentence. However,I get this error as follows. size mismatch for score.score.weight: copying a param with shape torch.Size([1, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([1, 128, 1, 1]).

I really don’t know how to alter it. Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
backseasoncommented, Jul 23, 2020

When you use the pretrained model obtained by joint training two tasks, you should use the joint_*.py.

0reactions
backseasoncommented, Jul 23, 2020

You’re welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve runtime error due to size mismatch in PyTorch?
I am getting an error when I run output =model(input). As per my knowledge, the linear layer flattens the image and executes something...
Read more >
Size mismatch error for tensors of equal size - PyTorch Forums
In VAE code I am trying to run, I get the error below, where the mismatched tensors seem like the same size. The...
Read more >
load_best_model_at_end failed due to "size mismatch" when ...
Steps to reproduce the behavior: Run run_clm.py without DeepSpeed finished successfully: + export TOKENIZERS_PARALLELISM=false + ...
Read more >
Solving Error: size mismatch, m1: [30 x 2], m2
There are multiple errors in the messages you showed. Maybe you tried running your code multiple times, commenting out or changing the lines ......
Read more >
T5ForConditionalGeneration checkpoint size mismatch #19418
weight". size mismatch for shared.weight: copying a param with shape torch.Size([32103, 512]) from checkpoint, the shape in current model is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found