I changed the softmax to log_softmax but it does not change the output, I am still having a problem in calculating the loss function

Traceback (most recent call last):
File “”, line 1, in 
File “mymodel.py”, line 147, in 
train(epoch)
File “mymodel.py”, line 119, in train
loss = F.nll_loss(output, target)
File “/home/slava/dev/miniconda2/lib/python2.7/site-packages/torch/nn/functional.py”, line 501, in nll_loss
return f(input, target)
File “/home/slava/dev/miniconda2/lib/python2.7/site-packages/torch/nn/_functions/thnn/auto.py”, line 41, in forward
output, *self.additional_args)
RuntimeError: Assertion `cur_target >= 0 && cur_target < n_classes’ failed.  at /b/wheel/pytorch-src/torch/lib/THNN/generic/ClassNLLCriterion.c:57