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

train_error! #4

Open
xaohuicai opened this issue Apr 28, 2020 · 0 comments
Open

train_error! #4

xaohuicai opened this issue Apr 28, 2020 · 0 comments

Comments

@xaohuicai
Copy link

Using a target size (torch.Size([1, 1, 768, 1024])) that is different to the input size (torch.Size([1, 1, 96, 128])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
Traceback (most recent call last):
File "train.py", line 214, in
main()
File "train.py", line 84, in main
train(train_list, model, criterion, optimizer, epoch)
File "train.py", line 136, in train
loss = criterion(output, target)
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/loss.py", line 443, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "/usr/local/lib/python3.5/dist-packages/torch/nn/functional.py", line 2256, in mse_loss
expanded_input, expanded_target = torch.broadcast_tensors(input, target)
File "/usr/local/lib/python3.5/dist-packages/torch/functional.py", line 62, in broadcast_tensors
return torch._C._VariableFunctions.broadcast_tensors(tensors)
RuntimeError: The size of tensor a (128) must match the size of tensor b (1024) at non-singleton dimension 3

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