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

I used web( and to train googlenet network . I changed pretrained=False in on the picture.

It is an error line:
Traceback (most recent call last):
File “”, line 514, in
File “”, line 135, in main
main_worker(args.gpu, ngpus_per_node, args)
File “”, line 285, in main_worker
train(train_loader, model, criterion, optimizer, epoch, num_classes, args)
File “”, line 339, in train
loss = criterion(output, target)
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/modules/”, line 722, in _call_impl
result = self.forward(*input, **kwargs)
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/modules/”, line 948, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/”, line 2422, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File “/home/bmw/.local/lib/python3.6/site-packages/torch/nn/”, line 1591, in log_softmax
ret = input.log_softmax(dim)
AttributeError: ‘GoogLeNetOutputs’ object has no attribute ‘log_softmax’

How can I solve its problem?

GoogLeNetOutputs is a Python namedtuple and you’d want the logits attribute from it.