Is your model working on the CPU?
Usually you would get a better error message by running your model on the CPU.
However, if you model is only raising this error in the GPU, could you rerun the code with:
CUDA_LAUNCH_BLOCKING=1 python scripy.py args

and post the stack trace here?
Often the class indices are not in the expected range of [0, nb_classes-1].