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]
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]