$ python3 -m venv env3
$ source env3/bin/activate
$ cd env3/share/python-wheels
$ wget https://download.pytorch.org/whl/cu100/torch-1.3.0%2Bcu100-cp36-cp36m-linux_x86_64.whl
$ wget https://download.pytorch.org/whl/cu100/torchvision-0.4.1%2Bcu100-cp36-cp36m-linux_x86_64.whl
$ pip install torch-1.3.0+cu100-cp36-cp36m-linux_x86_64.whl torchvision-0.4.1+cu100-cp36-cp36m-linux_x86_64.whl
>>>>>Processing ./torch-1.3.0+cu100-cp36-cp36m-linux_x86_64.whl
>>>>>Processing ./torchvision-0.4.1+cu100-cp36-cp36m-linux_x86_64.whl
>>>>>Collecting numpy (from torch==1.3.0+cu100)
>>>>>...................................................................
>>>>>Successfully installed numpy-1.17.3 pillow-6.2.1 six-1.12.0 torch-1.3.0+cu100 torchvision-0.4.1+cu100
$ python
$ import torch
>>> print(torch.version.cuda)
10.0.1
来源:博客园
作者:汤姆啾
链接:https://www.cnblogs.com/jeshy/p/11778283.html