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

Torch.size mismatch #59

Closed
djl0912111 opened this issue Jul 23, 2020 · 6 comments
Closed

Torch.size mismatch #59

djl0912111 opened this issue Jul 23, 2020 · 6 comments

Comments

@djl0912111
Copy link

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.

@backseason
Copy link
Owner

Did you use the joint_main.py file?

@djl0912111
Copy link
Author

I have just follow this sentence,
python main.py --mode='test' --model='results/run-*/models/final.pth' --test_fold='results/run-*-sal-e' --sal_mode='e'
because I just think the sentence ./forward.sh 2 joint_main.py results/run-* need 2 gpu, and I only have one. Did I wrongly understand it?

@backseason
Copy link
Owner

2 means the id of gpu to be used not the number of gpus.

@backseason
Copy link
Owner

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

@djl0912111
Copy link
Author

Thank you very much, I would try it. This is the first time I have met a writer who has responded so quickly. I feel really excited.

@backseason
Copy link
Owner

You're welcome!

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