@Abhilash_Srivastava I tried running the code on cpu instead of gpu. Now I am getting a much more detailed trace of the error.

Starting training …
Starting batch: 0
IndexError                                Traceback (most recent call last)
 in ()
----> 1 train(model, train_dataset)
2 frames
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in nll_loss(input, target, weight, size_average, ignore_index, reduce, reduction)
2262                          .format(input.size(0), target.size(0)))
2263     if dim == 2:
-> 2264         ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
2265     elif dim == 4:
2266         ret = torch._C._nn.nll_loss2d(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
IndexError: Target 545 is out of bounds.

Can you explain what this error supposed to mean ?