当前位置:网站首页>pytorch安装笔记——Pytorch在conda+CUDA10.2环境安装task01
pytorch安装笔记——Pytorch在conda+CUDA10.2环境安装task01
2022-08-11 05:15:00 【雾切凉宫】
Pytorch在conda+CUDA10.2环境安装
前言
由于之前电脑里安装的CUDA是10.2版本的,paddlepaddle什么的也装的是CUDA10.2的版本,不想再去重装CUDA。
如图:官方已经不支持CUDA10.2的版本了。官网地址:PyTorch
解决
安装过去的版本,点击上面的Previous PyTorch Versions,这里直接给个网址:Previous PyTorch Versions | PyTorch
可以看见有许多过去的版本,也有支持cuda10.2的,大家可以按需找自己要的
完整过程
创建conda虚拟环境
conda create -n env_name python==3.7
激活环境
conda activate env_name
conda换源
方式一 命令行(比较方便)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
建议把上面那些跑两遍
第一遍只能加channel,第二遍能把他们优先级提到默认源的前面(亲测被坑)
方式二 改文件
TUNA 提供了 Anaconda 仓库与第三方源的镜像,各系统都可以通过修改用户目录下的 .condarc
文件。Windows 用户无法直接创建名为 .condarc
的文件,可先执行conda config --set show_channel_urls yes
生成该文件之后再修改。
完成这一步后,我们需要修改C:\Users\User_name\.condarc
这个文件,打开后将文件里原始内容删除,将下面的内容复制进去并保存。
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
这一步完成后,我们需要打开Anaconda Prompt
运行 conda clean -i
清除索引缓存,保证用的是镜像站提供的索引。
安装pytorch
根据前面在官网找的支持cuda10.2的安装代码直接安装就好
#conda安装
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=10.2 -c pytorch
#pip安装
pip install torch==1.10.1+cu102 torchvision==0.11.2+cu102 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html
可以看到变成了清华源
然而我自己试下来清华源下pytorch也是300k/s小水管,建议pip
可以看到变成了清华源
[外链图片转存中…(img-5JDl2Wns-1655178124349)]
然而我自己试下来清华源下pytorch也是300k/s小水管,建议pip
成功!
边栏推荐
- postman脚本的应用
- Prometheus :(一)基本概念
- 一些常见mysql入门练习
- [No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
- redis集群模式--解决redis单点故障
- 报表控件Stimulsoft报告中的数据矩阵条形码介绍
- (一)Docker安装Redis实战(一主二从三哨兵)
- Redis details
- You must understand - the nine built-in objects and four domain objects of JSP
- selenuim使用cookie登录京东
猜你喜欢
【win10+cuda7.5+cudnn6.0安装caffe④】安装pycaffe
postman脚本的应用
Flask framework learning: trailing slashes for routes
redis连接idea
【win10+cuda7.5+cudnn6.0安装caffe③】编译及测试caffe
一、Jmeter环境部署
【嵌入式开源库】使用J-Link打印日志,让你节省一个打印串口
【备忘】从零开始搭建Yolo5训练环境
[Embedded open source library] The use of cJSON, an efficient and streamlined json parsing library
(3) How Redis performs stress testing
随机推荐
Redis详解
Sub-database sub-table ShardingSphere-JDBC notes arrangement
Flask framework learning: trailing slashes for routes
【CSDN21天学习挑战赛】第一天,配置环境外加实现mnist手写数字识别
(3) How Redis performs stress testing
Django--20实现Redis支持、上下文以及上下文和接口的交互
一张图带你解读--如何从零开始学习接口自动化
报表控件Stimulsoft报告中的数据矩阵条形码介绍
tensorflow代码翻译成pytorch代码 -详细教程+案例
The most complete installation tutorial of Pytorch (one step)
MySQL must know and must know (primary articles)
Flask框架学习:路由的尾部斜杠
PyTorch显存机制分析
2022年Android面试中最常问的问题是什么?
关于ie下href有中文出现RFC 7230 and RFC 3986问题的研究
总结:交叉验证
MySQL事务的概念
Pytorch最全安装教程(一步到位)
pytorch基础之 pytorch 模型开发模板
阿里云无法远程连接数据库MySQL错误码10060解决办法_转载