I am trying to run my project on Google Colab’s L4 GPU. However, I get the error:
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.
Its weird because everytime I run the project, this error seems to pop up in different places.
I also checked 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. I also use nn.CrossEntropyLoss()
, but the error occurs before that line.
I’m not sure what is the problem. Could someone help me?