zhanghang1989 / PyTorch-Encoding

A CV toolkit for my papers.
https://hangzhang.org/PyTorch-Encoding/
MIT License
2.04k stars 450 forks source link

AttributeError: 'tuple' object has no attribute 'log_softmax' #408

Closed wlj567 closed 2 years ago

wlj567 commented 2 years ago

Traceback (most recent call last): File "/home/pxg/DAN/DANet/experiments/segmentation/train.py", line 282, in <module> trainer.training(epoch) File "/home/pxg/DAN/DANet/experiments/segmentation/train.py", line 214, in training loss = self.criterion(outputs, target) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self.forward(*input, **kwargs) File "/home/pxg/DAN/DANet/encoding/parallel.py", line 130, in forward return self.module(inputs, *targets[0], **kwargs[0]) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__ result = self.forward(*input, **kwargs) File "/home/pxg/DAN/DANet/encoding/nn/loss.py", line 68, in forward return super(SegmentationLosses, self).forward(*inputs) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 904, in forward ignore_index=self.ignore_index, reduction=self.reduction) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/functional.py", line 1970, in cross_entropy return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/functional.py", line 1295, in log_softmax ret = input.log_softmax(dim) AttributeError: 'tuple' object has no attribute 'log_softmax' Hello, can you help me see what the problem is?

wlj567 commented 2 years ago

Traceback (most recent call last): File "/home/pxg/DAN/DANet/experiments/segmentation/train.py", line 282, in trainer.training(epoch) File "/home/pxg/DAN/DANet/experiments/segmentation/train.py", line 214, in training loss = self.criterion(outputs, target) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/home/pxg/DAN/DANet/encoding/parallel.py", line 130, in forward return self.module(inputs, *targets[0], *kwargs[0]) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/home/pxg/DAN/DANet/encoding/nn/loss.py", line 68, in forward return super(SegmentationLosses, self).forward(*inputs) File"/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 904, in forward ignore_index=self.ignore_index, reduction=self.reduction) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/functional.py", line 1970, in cross_entropy return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction) File "/home/pxg/DAN/venv/lib/python3.6/site-packages/torch/nn/functional.py", line 1295, in log_softmax ret = input.log_softmax(dim) AttributeError: 'tuple' object has no attribute 'log_softmax'`

zhanghang1989 commented 2 years ago

This looks like code from other project. Please ask the original author to support.

wlj567 commented 2 years ago

Ok!