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

how to chnage the input h w of image? #216

Open
henbucuoshanghai opened this issue Oct 3, 2021 · 0 comments
Open

how to chnage the input h w of image? #216

henbucuoshanghai opened this issue Oct 3, 2021 · 0 comments

Comments

@henbucuoshanghai
Copy link

when training has this error

warnings.warn(warning.format(ret))
0%| | 0/1539 [00:00<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 304, in
main()
File "train.py", line 297, in main
trainer.training(epoch)
File "train.py", line 106, in training
loss = self.criterion(output, target)
File "/home/Pictures/pytorch-deeplab-xception/utils/loss.py", line 28, in CrossEntropyLoss
loss = criterion(logit, target.long())
File "/home//anaconda3/envs/lili/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home//anaconda3/envs/lili/lib/python3.8/site-packages/torch/nn/modules/loss.py", line 1120, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "/home//anaconda3/envs/lili/lib/python3.8/site-packages/torch/nn/functional.py", line 2824, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
RuntimeError: 1only batches of spatial targets supported (3D tensors) but got targets of size: : [2, 513, 513, 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