因為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
再跑即可以修復