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

dimension mismatch #138

Closed
johnathanchiu opened this issue Dec 30, 2018 · 9 comments
Closed

dimension mismatch #138

johnathanchiu opened this issue Dec 30, 2018 · 9 comments

Comments

@johnathanchiu
Copy link

johnathanchiu commented Dec 30, 2018

I got this error

RuntimeError: Given groups=1, weight of size [512, 320, 1, 1], expected input[1, 2048, 1, 1] to have 320 channels, but got 2048 channels instead

I saw the other thread and I tried changing it to 512 but it still didn't work

@hangzhaomit
Copy link
Collaborator

Can you let me know the command you are running?

@johnathanchiu
Copy link
Author

johnathanchiu commented Dec 31, 2018

I'm running through PyCharm but here are my defaults:

screen shot 2018-12-30 at 6 05 13 pm

@hangzhaomit
Copy link
Collaborator

please use the default fc_dim, which is 2048

@johnathanchiu
Copy link
Author

I used the default. This is the new error I got:

RuntimeError: Error(s) in loading state_dict for PPMDeepsup:
size mismatch for cbr_deepsup.0.weight: copying a param with shape torch.Size([80, 160, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1024, 3, 3]).
size mismatch for cbr_deepsup.1.weight: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for cbr_deepsup.1.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for cbr_deepsup.1.running_mean: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for cbr_deepsup.1.running_var: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for cbr_deepsup.1._tmp_running_mean: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for cbr_deepsup.1._tmp_running_var: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for conv_last_deepsup.weight: copying a param with shape torch.Size([150, 80, 1, 1]) from checkpoint, the shape in current model is torch.Size([150, 512, 1, 1]).

@hangzhaomit
Copy link
Collaborator

What command are you running?

@johnathanchiu
Copy link
Author

I'm not running any specific commands, I'm just using the defaults on pycharm. Should I run it from my terminal using the commands in the readme?

@hangzhaomit
Copy link
Collaborator

yes

@johnathanchiu
Copy link
Author

I did everything from the readme. Still getting the same error not quite sure what's going wrong. I didn't change any dimensions. I'm running this bash command:

python3 -u test.py
--model_path /Users/[User]/Downloads/semantic-segmentation-pytorch-master-3/baseline-resnet50dilated-ppm_deepsup
--test_imgs /Users/[User]/Downloads/IMG_0106.jpeg
--arch_encoder resnet50dilated
--arch_decoder ppm_deepsup

@hangzhaomit
Copy link
Collaborator

If you are able to run the quick start ./demo_test.sh, then your setup should be correct.

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