【发布时间】:2021-09-10 22:58:05
【问题描述】:
我正在尝试在启用 GPU 的 Google Colab 上初始化一个张量。
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
t = torch.tensor([1,2], device=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
即使将该环境变量设置为 1,似乎也没有显示任何进一步的细节。
有人遇到过这个问题吗?
【问题讨论】:
-
你应该把你的笔记本恢复出厂设置然后试试。
标签: pytorch google-colaboratory tensor