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]

 

ubuntu16.04 安装 Pytorch_第1张图片

pip3 install torch torchvision

验证

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

torch版本查看

import torch
print(torch.__version__)

torchvision版本查看

import torchvison

torchvision.__version__

ubuntu16.04 安装 Pytorch_第2张图片

torchvision卸载

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

pip3 uninstall torchvision

 

你可能感兴趣的:(深度学习框架,pytorch)