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 版本匹配的。
博上文章,均属原创,如需转载,请注明出处