因为ubuntu 系统是14.0的,安装pytorch1.0的时候,本身已经安装好了cuda8,在验证gpu的时候,torch.cuda.is_available()返回false

安装命令是:

conda install pytorch=1.0.1 cuda80 -c pytorch

但是验证:


res = torch.cuda.is_available()
print(res)

返回false,这时候参考网上的,安装

pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html

即可,如果下载过程中报错,如下:

Looking in links: https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html
Collecting torch_nightly
Downloading https://download.pytorch.org/whl/nightly/cu80/torch_nightly-1.1.0.dev20190502-cp37-cp37m-linux_x86_64.whl (620.6MB)
| | 686kB 77kB/s eta 2:14:05ERROR: Exception:
Traceback (most recent call last):

 

使用多线程下载工具下载:

aria2c --dir=./ --max-connection-per-server=16 --max-concurrent-downloads=16 --split=16 --continue=true "https://download.pytorch.org/whl/nightly/cu80/torch_nightly-1.1.0.dev20190502-cp37-cp37m-linux_x86_64.whl"

pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html

再跑即可以修复