8000 NLLLoss cant work · Issue #57 · fyu/drn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NLLLoss cant work #57

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

Open
cmdjzs opened this issue Sep 18, 2021 · 0 comments
Open

NLLLoss cant work #57

cmdjzs opened this issue Sep 18, 2021 · 0 comments

Comments

@cmdjzs
Copy link
cmdjzs commented Sep 18, 2021

hi,I meet some trouble while training on myself dataset which only have 3 classes.
environment is: Ubuntu 18.04; conda, cuda etc all is satisfied.
Please help,any advice is appreciate!thanks a lot.

Traceback (most recent call last):
File "segment1.py", line 734, in
main()
File "segment1.py", line 728, in main
train_seg(args)
File "segment1.py", line 418, in train_seg
validate(val_loader, model, criterion, eval_score=accuracy)
File "segment1.py", line 223, in validate
loss = criterion(output, target_var)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 726, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 212, in forward
return F.nll_loss(input, target, weight=self.weight, ignore_index=self.ignore_index, reduction=self.reduction)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/functional.py", line 2243, in nll_loss
ret = torch._C._nn.nll_loss2d(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
RuntimeError: 1only batches of spatial targets supported (3D tensors) but got targets of size: : [1, 3, 840, 840]

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
0