terminate called after throwing an instance of 'c10::CUDAError' what(): CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
如果你更换了数据集,并且本来能跑的代码突然报错如上,那么就是因为数据集太大了,爆显存了。调小数据集就可以了