Chinese-Text-Classification-PyTorch icon indicating copy to clipboard operation
Chinese-Text-Classification-PyTorch copied to clipboard

Transformer跑不通

Open Jason-shc opened this issue 1 year ago • 1 comments

Transformer.py文件中的out = x + nn.Parameter(self.pe, requires_grad=False).to(self.device)报错: 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. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions. 这是为什么

Jason-shc avatar May 21 '24 15:05 Jason-shc

Transformer.py文件中的out = x + nn.Parameter(self.pe, requires_grad=False).to(self.device)报错: 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. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions. 这是为什么

参考这个看看:https://discuss.pytorch.org/t/how-to-fix-cuda-error-device-side-assert-triggered-error/137553/3

JackHCC avatar Jul 18 '24 15:07 JackHCC