Skip to content

fixed tensor size issue #107

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

Closed
wants to merge 3 commits into from
Closed

fixed tensor size issue #107

wants to merge 3 commits into from

Conversation

lukevc
Copy link

@lukevc lukevc commented Mar 31, 2022

RuntimeError: The size of tensor a (78) must match the size of tensor b (64) at non-singleton dimension 2

printing the shape of tensors real and fake inside of the gradient_penalty function in utils.py (directly before the images are interpolated) shows that real has height of 78 instead of 64.
real = torch.Size([64, 3, 78, 64])
fake = torch.Size([64, 3, 64, 64])

Fixed the issue by changing transforms.Resize in train.py from transforms.Resize(IMAGE_SIZE) to transforms.Resize((IMAGE_SIZE, IMAGE_SIZE))

lukevc added 3 commits March 31, 2022 21:55
`RuntimeError: The size of tensor a (78) must match the size of tensor b (64) at non-singleton dimension 2`

printing the shape of tensors real and fake inside of the gradient_penalty function in utils.py (directly before the images are interpolated) shows that real has height of 78 instead of 64.
real = torch.Size([64, 3, 78, 64])
fake = torch.Size([64, 3, 64, 64])

Fixed the issue by changing transforms.Resize in train.py from transforms.Resize(IMAGE_SIZE) to transforms.Resize((IMAGE_SIZE, IMAGE_SIZE))
@lukevc lukevc closed this by deleting the head repository Jun 12, 2023
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

Successfully merging this pull request may close these issues.

1 participant