pytorch环境配置(win10)

一、Pytorch环境配置

1、根据要运行的代码来选择安装哪个版本的pytorch和python,依据代码配置相关的环境;

2、环境配置

例如:我要运行的一个代码环境是:pytorch 1.5.0 和python 3.6.5

conda create -n pytorch1.5 python=3.6.5

其中pytorch1.5是为配置的环境取的环境名;

3、激活环境

conda activate pytorch1.5

4、安装pytorch

进入pytorch官网,选择的是pytorch 1.5.0,无GPU版本;在已更换镜像源的情况下,删除后面的

-c pytorch

conda install pytorch==1.5.0 torchvision==0.6.0 cpuonly -c pytorch

5、相关库的安装

例如:CV2库的安装

pip insatll opencv-python

若出现错误:Cache entry deserialization failed, entry ignored;

Command "python setup.py egg_info" failed with error code 1 in

则更新pip

python -m pip install --upgrade pip

二、环境配置时出现如下错误:

ProxyError: conda cannot proceed due to an error in your proxy configuration.Check for typos and other configuration errors in any '.netrc' file in your home directory,any environment variables ending in '_PROXY', and any other system-wide proxy configuration settings.

修改方法:

1、在Internet中打开“Internet选项”——>连接——>局域网设置——>把“为LAN使用代理服务器”的勾去掉。

2、按Win+R快捷键,输入regedit,打开注册表编辑器找到HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings分支,把它下面以 Proxy 打头的键值对(如ProxyEnable,ProxyOverride,ProxyServer等)全部删除。
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值