You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,When I began to train this model, this problem appeared in the loss function.
Traceback (most recent call last):
File "/home/caiweixin/Downloads/DANet-master/experiments/segmentation/train.py", line 287, in
trainer.training(epoch)
File "/home/caiweixin/Downloads/DANet-master/experiments/segmentation/train.py", line 219, in training
loss = self.criterion(outputs, target)
File "/home/caiweixin/Downloads/DANet-master/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/caiweixin/Downloads/DANet-master/encoding/nn/loss.py", line 69, in forward
return super(SegmentationLosses, self).forward(*inputs)
File "/home/caiweixin/Downloads/DANet-master/venv/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 1121, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File "/home/caiweixin/Downloads/DANet-master/venv/lib/python3.7/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)
TypeError: cross_entropy_loss(): argument 'input' (position 1) must be Tensor, not tuple
Process finished with exit code 1
How can I solve this problem?thank you.
The text was updated successfully, but these errors were encountered:
Hi,When I began to train this model, this problem appeared in the loss function.
Traceback (most recent call last):
File "/home/caiweixin/Downloads/DANet-master/experiments/segmentation/train.py", line 287, in
trainer.training(epoch)
File "/home/caiweixin/Downloads/DANet-master/experiments/segmentation/train.py", line 219, in training
loss = self.criterion(outputs, target)
File "/home/caiweixin/Downloads/DANet-master/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/caiweixin/Downloads/DANet-master/encoding/nn/loss.py", line 69, in forward
return super(SegmentationLosses, self).forward(*inputs)
File "/home/caiweixin/Downloads/DANet-master/venv/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 1121, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File "/home/caiweixin/Downloads/DANet-master/venv/lib/python3.7/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)
TypeError: cross_entropy_loss(): argument 'input' (position 1) must be Tensor, not tuple
Process finished with exit code 1
How can I solve this problem?thank you.
The text was updated successfully, but these errors were encountered: