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: output size is error #2

Open
gjy3035 opened this issue Jan 2, 2018 · 1 comment
Open

RuntimeError: output size is error #2

gjy3035 opened this issue Jan 2, 2018 · 1 comment

Comments

@gjy3035
Copy link

gjy3035 commented Jan 2, 2018

I try to train the model, but the output size is error:

RuntimeError: input and target batch or spatial sizes don't match: target [4 x 512 x 1024], input [4 x 20 x 1534 x 3070] at /pytorch/torch/lib/THCUNN/generic/SpatialClassNLLCriterion.cu:24

[4 x 512 x 1024] is the size of label.
[4 x 20 x 1534 x 3070] is the size of model output.

How to solve it?

@gjy3035
Copy link
Author

gjy3035 commented Jan 3, 2018

Through comparing with original lua code, I maybe find the reason of inconsistent sizes.
In model.py, Line 34:

self.Convolution = nn.ConvTranspose2d

should be:

self.Convolution = nn.Conv2d

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

1 participant