Anaconda3安装Pytorch

先按照这个流程来

手把手教你安装pytorch(包教会)_歌者And贰向箔的博客-CSDN博客_安装pytorch

然后会出现一个问题

问题:
(pytorch) C:\Users\Mike>conda install pytorch torchvision torchaudio cudatoolkit=11.3
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/pkgs/free/noarch/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))

然后参考了这个链接

Anaconda建立新的环境,出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url ...... 解决过程 - tianlang25 - 博客园m

常见问题1:我没有.condarc文件咋办啊?
Windows 用户有时无法直接创建名为 .condarc 的文件,可先在Anaconda Powershell Prompt中执行 conda config --set show_channel_urls yes命令,生成该文件之后再修改。

创建.condarc文件,修改为

ssl_verify: true
show_channel_urls: true

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/

然后又出现一个问题

(pytorch) C:\Users\Mike>conda install pytorch torchvision torchaudio cudatoolkit=11.3
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - torchaudio
  - torchvision

Current channels:

  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

再把.condarc文件修改一下,修改为如下

ssl_verify: true
show_channel_urls: true

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

安装信息显示,


  - torchaudio
  - torchvision

这两个包的源在

http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch

这个时候Pytorch环境创建成功,但是没有CUDA

你可能感兴趣的:(Anaconda3,pytorch,深度学习,人工智能)