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

AttributeError: 'tuple' object has no attribute 'log_softmax' when run inception_v3 #27

Closed
binbinmeng opened this issue Jul 10, 2018 · 3 comments

Comments

@binbinmeng
Copy link

binbinmeng commented Jul 10, 2018

python main.py -a inception_v3 --epoch 5 -b 64 /workspace/imagenet/ --fp16
=> creating model 'inception_v3'
Traceback (most recent call last):
File "main.py", line 466, in
main()
File "main.py", line 212, in main
train(train_loader, model, criterion, optimizer, epoch)
File "main.py", line 293, in train
loss = criterion(output, target_var)
File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 779, in forward
self.ignore_index, self.reduce)
File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/functional.py", line 1454, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, size_average, ignore_index, reduce)
File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/functional.py", line 946, in log_softmax
return input.log_softmax(dim)
AttributeError: 'tuple' object has no attribute 'log_softmax'

node:
In [2]: print(torch.version)
0.5.0a0

@mcarilli
Copy link
Contributor

Thanks for letting me know, I'll see if I can reproduce this tomorrow.

@csarofeen
Copy link
Collaborator

This is known for inception_v3, please see pytorch/vision#302

lcskrishna added a commit to lcskrishna/apex that referenced this issue Jul 15, 2020
* Enable sync batchnorm

* enable syncbn properly

* update the unit tests

* update tests

* update conditions for welford_merge_element

* updated conditions based on comments.
@wlj567
Copy link

wlj567 commented Oct 27, 2021

Traceback (most recent call last):
File "/home/pxg/DAN/DANet/experiments/segmentation/train.py", line 292, in
trainer.training(epoch)
File "/home/pxg/DAN/DANet/experiments/segmentation/train.py", line 214, in training
aux1, aux2, outputs = self.model(image)
ValueError: not enough values to unpack (expected 3, got 1)

Hello, I modified it according to the above method and still reported an error. Can you help me see it? Thank you very much.

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

4 participants