pytorch-deeplab-xception icon indicating copy to clipboard operation
pytorch-deeplab-xception copied to clipboard

how to chnage the input h w of image?

Open henbucuoshanghai opened this issue 4 years ago • 0 comments

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]

henbucuoshanghai avatar Oct 03 '21 10:10 henbucuoshanghai