backseason / PoolNet

Code for our CVPR 2019 paper "A Simple Pooling-Based Design for Real-Time Salient Object Detection"
MIT License
628 stars 153 forks source link

Torch.size mismatch #59

Closed djl0912111 closed 4 years ago

djl0912111 commented 4 years ago

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 commented 4 years ago

Did you use the joint_main.py file?

djl0912111 commented 4 years ago

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 commented 4 years ago

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

backseason commented 4 years ago

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

djl0912111 commented 4 years ago

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 commented 4 years ago

You're welcome!