Bert-Chinese-Text-Classification-Pytorch icon indicating copy to clipboard operation
Bert-Chinese-Text-Classification-Pytorch copied to clipboard

RuntimeError: CUDA error: device-side assert triggered

Open blueyeee opened this issue 1 year ago • 0 comments

每次都是跑到700句的时候出错,想问问大佬们问题出现在哪里

C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Loss.cu:242: block: [0,0,0], thread: [6,0,0] Assertion t >= 0 && t < n_classes failed. Traceback (most recent call last): File "run.py", line 37, in File "D:\AAWork\PyCharm Community Edition 2021.3.1\AApythonProject\bishe\text1\utils.py", File "D:\AAWork\PyCharm Community Edition 2021.3.1\AApythonProject\bishe\text1\utils.py", File "D:\AAWork\PyCharm Community Edition 2021.3.1\AApythonProject\bishe\text1\utils.py", line File "D:\AAWork\PyCharm Community Edition 2021.3.1\AApythonProject\bishe\text1\utils.py", line 75, in next batches = self._to_tensor(batches) File "D:\AAWork\PyCharm Community Edition 2021.3.1\AApythonProject\bishe\text1\utils.py", line 54, in to_tensor x = torch.LongTensor([[0] for _ in datas]).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.

blueyeee avatar Feb 27 '23 12:02 blueyeee