anaconda 下创建环境并安装pytorch更早版本的记录

cmd

activate 环境名

【原始pytorch安装遇到“Conda - Downloaded bytes did not match Content-Length的问题",参考以下链接,然后更换了清华源解决Conda - Downloaded bytes did not match Content-Length 问题解决方案_condaerror: downloaded bytes did not match content_月夜长影的博客-CSDN博客”】

1. 配置清华镜像源文件如下:

第一步,打开终端,执行如下命令,会在当前用户目录下生成一个.condarc的文件

conda config --set show_channel_urls yes

第二步,复制或者编辑如下内容到.condarc文件中。

show_channel_urls: true
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
envs_dirs:
  - D:\ProgramData\Anaconda3\envs
pkgs_dirs:
  - D:\ProgramData\Anaconda3\pkgs

第三步,在终端中执行如下命令,清除历史索引缓存

conda clean -i

第四步,查询pyTorch官网,执行对应版本的安装命令

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c nvidia

注意:记得去掉 -c pytorch!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值