attn = torch.bmm(q, k.transpose(1, 2))
RuntimeError: cublas runtime error : the GPU program failed to execute at /tmp/pip-req-build-w6wf0mqz/aten/src/THC/THCBlas.cu:368

 

报错原因:

安装的torch不是 cuda版本的。需要 更改为 cuda版本。

 

pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113

可以逐个下载:
https://download.pytorch.org/whl/cu113/torchaudio-0.12.1%2Bcu113-cp38-cp38-linux_x86_64.whl
https://download.pytorch.org/whl/cu113/torch-1.12.1%2Bcu113-cp38-cp38-linux_x86_64.whl
还有一个在这里找:
https://download.pytorch.org/whl/cu113/
找到 跟你 cuda 版本匹配的。
 
posted on 2022-11-07 11:16  曾冠奇  阅读(1415)  评论(0编辑  收藏  举报