AttributeError: 'GoogLeNetOutputs' object has no attribute 'log_softmax'

username: 111296
cooked: <p>I used web(<a href="https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-collect.md" class="inline-onebox" rel="noopener nofollow ugc">jetson-inference/docs/pytorch-collect.md at master · dusty-nv/jetson-inference · GitHub</a>) and train.py(<a href="https://github.com/dusty-nv/pytorch-classification/blob/5107de352cade326e7aacd44bf8d625b7055fd4e/train.py" class="inline-onebox" rel="noopener nofollow ugc">pytorch-classification/train.py at 5107de352cade326e7aacd44bf8d625b7055fd4e · dusty-nv/pytorch-classification · GitHub</a>) to train googlenet network . I changed pretrained=False in train.py on the picture.</p>
<p>It is an error line:<br>
Traceback (most recent call last):<br>
File “train.py”, line 514, in <br>
main()<br>
File “train.py”, line 135, in main<br>
main_worker(args.gpu, ngpus_per_node, args)<br>
File “train.py”, line 285, in main_worker<br>
train(train_loader, model, criterion, optimizer, epoch, num_classes, args)<br>
File “train.py”, line 339, in train<br>
loss = criterion(output, target)<br>
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 722, in _call_impl<br>
result = self.forward(*input, **kwargs)<br>
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/modules/loss.py”, line 948, in forward<br>
ignore_index=self.ignore_index, reduction=self.reduction)<br>
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/functional.py”, line 2422, in cross_entropy<br>
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)<br>
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/functional.py”, line 1591, in log_softmax<br>
ret = input.log_softmax(dim)<br>
AttributeError: ‘GoogLeNetOutputs’ object has no attribute ‘log_softmax’</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/7/c718990e5dd313bfc71659f53079c898454dd4ad.png" data-download-href="https://discuss.pytorch.org/uploads/default/c718990e5dd313bfc71659f53079c898454dd4ad" title="2020-09-28 22-20-19 的螢幕擷圖"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/c/7/c718990e5dd313bfc71659f53079c898454dd4ad_2_499x499.png" alt="2020-09-28 22-20-19 的螢幕擷圖" data-base62-sha1="sphItovJmTBDPOhEjkz9cHPYZu5" width="499" height="499" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/c/7/c718990e5dd313bfc71659f53079c898454dd4ad_2_499x499.png, https://discuss.pytorch.org/uploads/default/optimized/3X/c/7/c718990e5dd313bfc71659f53079c898454dd4ad_2_748x748.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/c/7/c718990e5dd313bfc71659f53079c898454dd4ad.png 2x" data-dominant-color="ECEBEE"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">2020-09-28 22-20-19 的螢幕擷圖</span><span class="informations">964×965 144 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>How can I solve its problem?</p>

username: tom
cooked: <p>GoogLeNetOutputs is a Python namedtuple and you’d want the <code>logits</code> attribute from it.</p>