RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
在做分类模型代码训练的时候报错,这个是因为分类标签应该从0开始,我是从1开始的所以出问题了。比如第一类标签为0,第二类为2,。。。以此类推,第n类为N-1。n类标签是0到n-1 如果不减1就会越界报错。分类标签应该为:label = 类别编号-1,修改后即可解决