ubuntu16.04 安装 Pytorch

pytorch网址:

https://pytorch.org/

torchvison网址:

https://pypi.org/project/torchvision/0.2.0/


Via pip

从对应的网站下载whl文件

# CPU-only build

  • https://download.pytorch.org/whl/cpu/torch_stable.html

# CUDA 8.0 build

  • https://download.pytorch.org/whl/cu80/torch_stable.html

# CUDA 9.0 build

  • https://download.pytorch.org/whl/cu90/torch_stable.html

# CUDA 9.2 build

  • https://download.pytorch.org/whl/cu92/torch_stable.html

# CUDA 10.0 build

  • https://download.pytorch.org/whl/cu100/torch_stable.html

使用如下命令安装

pip install [downloaded file]

 

pip3 install torch torchvision

验证

import torch
import torchvision
print(torch.cuda.is_available())

torch版本查看

import torch
print(torch.__version__)

torchvision版本查看

import torchvison

torchvision.__version__

torchvision卸载

卸载的时候,会提示版本号

pip3 uninstall torchvision

 


版权声明:本文为TYUT_xiaoming原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。