关于安装pytorch,网上有很多大牛的教程,此文主要是针对个人安装过程中遇到的一些问题如何解决的做个简单的介绍,旨在帮助跟我一样遇到困难的小伙伴。
conda create -n pytorch python=3.6
出现下面这个错误的话
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/win-64/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')],)",),))',),)
大体就是 将原channels中的所有https改为http即可
如果按照上文的step4还出现下面这个错误的话,
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/win-64/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')],)",),))',),)
把在anaconda Prompt输入的下面这段代码中的https去掉s
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
也就是更改后的代码是
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
这个大概是网络安全的原因,https协议是有安全性的ssl加密传输协议,是浏览器和服务器之间的通信加密,这样来确保传输的安全。
Original: https://blog.csdn.net/m0_56836274/article/details/124552993
Author: 战绽
Title: 非英伟达显卡安装pytorch
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/711415/
转载文章受原作者版权保护。转载请注明原作者出处!