尝试运行 https://github.com/jadore801120/attention-is-all-you-need-pytorch 时出错,针对torch版本进行了修改。
torch官网上最新版本的torch支持的cuda最低版本为92,服务器上cuda版本为9.0,如果安装最新版的torch运行时会报错
The NVIDIA driver on your system is too old (found version 9010).
因此只能安装以前的版本的torch
一开始安装了0.3version的torch,torch版本的查看方法是:
import torch
print(torch.__version__)
在运行的时候报错
module 'torch' has no attribute 'device'
原因是torch版本太老了,要升级torch,但是还不能升级到最高版,因为cuda跟不上
为解决这个问题,torch至少要升级到0.4version以上,建议1.0以上吧,要不然还有其他的问题。