Could you check, if the labels contains only values in the range [0, nb_classes-1]?
If you are using PyTorch 1.5.0, could you update to 1.5.1, as we had a bug in 1.5.0, which skips the valid assertions inside some CUDA methods and instead crashes with these unfriendly CUDA errors?