下载cuda和cudnn

参考以下文章:
链接: pytorch -gpu 环境配置

遇到的问题:

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/repodata.json
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/win-64/repodata.json (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘ssl3_get_server_certificate’, ‘certificate verify failed’)])”)))’))
解决方案:
链接: Anaconda安装pytorch出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url 解决

进入”C:\Users\Administrator“,打开“.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/

然后在Anaconda Prompt 中输入

conda create -n pytorch_gpu python=3.7

输入进入pytorch_gpu的虚拟环境

conda info --envs
conda activate pytorch_gpu

找到安装pytorch的命令

网站链接
在这里插入图片描述

输入虚拟环境中,等待下载

在这里插入图片描述

测试pytorch CUDA是否可用

进入pytorch_gpu下的python
在这里插入图片描述

检测计算机测试显卡CUDA是否正常

cmd输入

cd C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\extras\demo_suite
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\extras\demo_suite>bandwidthTest.exe
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\extras\demo_suite>deviceQuery.exe

结果PASS则正常

更多推荐