Hi,
To get a better error message you can run the same thing on CPU.
In this case the error is that your label is not in 0 <= your_label < n_classes.
If you say that no label is negative, then one must be greater than your number of classes.
This is easy to check by checking the value of your label tensor and make sure it they are not too large.