安装pytorch遇到的问题

安装pytorch==1.7.0

安装命令:

`pip install pytorch==1.7.0`

报错:

在这里插入图片描述

`ERROR: No matching distribution found for pytorch==1.7.0`

去pytorch看了一下官方教程:

在对应的版本最好使用的命令应该是:

v1.7.0

Conda

OSX

# conda
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 -c pytorch

Linux and Windows

# CUDA 9.2
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=9.2 -c pytorch

# CUDA 10.1
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch

# CUDA 10.2
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.2 -c pytorch

# CUDA 11.0
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch

# CPU Only
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0

Linux and Windows

# CUDA 11.0
pip install torch==1.7.0+cu110 torchvision==0.8.0+cu110 torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

# CUDA 10.2
pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0

# CUDA 10.1
pip install torch==1.7.0+cu101 torchvision==0.8.0+cu101 torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

# CUDA 9.2
pip install torch==1.7.0+cu92 torchvision==0.8.0+cu92 torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

# CPU only
pip install torch==1.7.0+cpu torchvision==0.8.0+cpu torchaudio==0.7.0 -f https://download.pytorc

于是我使用了安装命令:

`pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 Collecting torch==1.7.0`

但是再度遇到了报错:

在这里插入图片描述

`ERROR: torch has an invalid wheel, .dist-info directory not found`

不得不再度查询解决方法,从官网上查找相关问题以及解决方法:官方网站上有关 CUDA 版本的更多详细信息

可以尝试以下命令:

如果您不需要 CUDA 安装

pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

如果您需要安装 CUDA

pip install torch===1.7.0 torchvision===0.8.1 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

If you do not need a CUDA installation

pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

If you fo need a CUDA installation

pip install torch===1.7.0 torchvision===0.8.1 torchaudio===0.7.0

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