train function does not occur error, but validate function occur error.
Traceback (most recent call last):
File “/home/lab326/songpeng/my_code/train.py”, line 562, in 
Loss, Accuracy=main()
File “/home/lab326/songpeng/my_code/train.py”, line 508, in main
precision, avg_loss = validate(val_loader, model, criterion)
File “/home/lab326/songpeng/my_code/train.py”, line 231, in validate
loss = criterion(y_pred[0], target)
File “/home/lab326/.local/lib/python3.5/site-packages/torch/nn/modules/module.py”, line 477, in call
result = self.forward(*input, **kwargs)
File “/home/lab326/.local/lib/python3.5/site-packages/torch/nn/modules/loss.py”, line 862, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File “/home/lab326/.local/lib/python3.5/site-packages/torch/nn/functional.py”, line 1550, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File “/home/lab326/.local/lib/python3.5/site-packages/torch/nn/functional.py”, line 975, in log_softmax
return input.log_softmax(dim)
RuntimeError: Dimension out of range (expected to be in range of [-1, 0], but got 1)