当前位置:网站首页>深度学习21天——准备(环境配置)
深度学习21天——准备(环境配置)
2022-08-04 04:28:00 【清园暖歌】
目录
活动地址:CSDN21天学习挑战赛
一、环境配置(Win 10)
1.1 语言环境(python 3.6)
详解Anaconda + 如何在Anaconda上更换python版本_宇内虹游的博客-CSDN博客_anaconda python版本
参考这位博主的文章,因为 tensorflow 2.3 只兼容python 3.5~3.7,而我的anconda中安装的默认版本是3.8,所以安装3.6版本
首先
conda create -n py36 python=3.6.5
安装完后开始激活
conda activate py36
此时会发现python版本已经更换成功,而要切换回默认版本的话,只需执行
conda activate base

可能会遇到的问题
Anaconda切换python版本_豆子前端的博客-CSDN博客_anaconda更改python版本
1.2 深度学习环境(TensorFlow2)
TensorFlow配置参考
Anaconda安装使用及tensorflow配置_坚强的敏敏子的博客-CSDN博客_如何使用anaconda安装tensorflow
因为存在gpu所以安装GPU版本

1.2.1 CUDA安装
查看自己的版本:搜索栏搜索 NVIDIA Control Panel ,点击左下角 系统信息 -组件 查看版本

我这里选择 cuda的版本是 11.1.1,cudnn选择该 8.4.0 版本


配置CUDA环境变量时主要参考这篇,到 “四、安装成功”
CUDA学习:Windows下的CUDA环境配置_三鲜豆皮的博客-CSDN博客_cuda配置环境变量
其他安装 cuda 和 cudnn 可参考的文章
CUDA和CUDNN的安装(带有详细步骤)_时芷_的博客-CSDN博客_cuda cudnn
CUDA安装教程(超详细)_Billie使劲学的博客-CSDN博客_cuda安装
【CUDA】cuda安装 (windows版)_何为xl的博客-CSDN博客_cuda windows
中间安装时电脑莫名重启了一次后就一直下载安装包失败,所以尝试 local 安装,但是又出现安装失败,发现是Nsight Visual Studio Edition失败,参考下面博主的文章,在自定义安装选项将Hsight VSE取消勾选后安装成功
另外我还取消勾选了 Visual Studio Integration

安装CUDA失败的情况nsight visual studio edition失败_Redamancy06的博客-CSDN博客_cuda安装vs失败
取消勾选的我暂时没有管他,如果后面有影响再解决
检查一下

cuda安装成功
1.2.2 CUDNN
直接复制cudnn 解压文件夹下的所有到cuda 的安装路径,因为我是自定义选择的路径,创建了两个文件夹,所以都复制进去了

1.2.3 tensorflow安装
切换到我新建的 py36 的环境,直接安装
conda install tensorflow-gpu==2.1.0
安装时注意版本问题
[tensorflow]各个tensorflow版本和CUDA版本对应,以及各个GPU版本CUDA和cuDNN对应_帅兄心安否的博客-CSDN博客_cuda110对应tensorflow版本
低版本tensorflow不知道是否可以兼容

验证是否可用,参考
tensorflow-gpu安装教程【1.x版本与2.x版本都适用的安装教程】cuda与cudnn简单安装(避坑),无需去官网下载_山风wind的博客-CSDN博客

返回True,还行
要更新的话,直接重新安装tensorflow
pip install tensorflow-gpu==2.4.1 --user -i https://pypi.mirrors.ustc.edu.cn/simple/
输入 pip list 查看结果
如果出现 ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问
的错误,是因为权限的问题,看看上面的命令有没有加上 --user
其他可能出现的问题
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.1.0 requires gast==0.2.2, but you have gast 0.4.0 which is incompatible.
tensorflow 2.1.0 requires scipy==1.4.1; python_version >= "3", but you have scipy 1.6.2 which is incompatible.
tensorflow 2.1.0 requires tensorboard<2.2.0,>=2.1.0, but you have tensorboard 2.5.0 which is incompatible.
tensorflow 2.1.0 requires tensorflow-estimator<2.2.0,>=2.1.0rc0, but you have tensorflow-estimator 2.5.0 which is incompatible.
aiohttp 3.7.4 requires chardet<4.0,>=2.0, but you have chardet 4.0.0 which is incompatible.
参考下篇文章
conda 环境中 一些包安装问题总结_w_bird的博客-CSDN博客
二、编译器(Jupyter Notebook)
安装的话直接在 Anaconda 中的环境下 install 即可
关于 Jupyter Notebook 修改打开目录,可参考博主自己的一篇文章
Jupyter——两个环境分别修改默认打开目录(Anaconda)_清园暖歌的博客-CSDN博客
注意及时关闭不用的内核:kernel - shut down
终端按 ctrl + c 退出
至此,环境配置应该。。差不多。。搞完了吧。。。
深受毒害!!!
边栏推荐
- 2022软件测试面试题 最新字节跳动50道真题面试题 刷完已拿下15k 附讲解+答疑
- SQL interview Questions
- if,case,for,while
- sql语句查询String类型字段小于10的怎么查
- 数组相关 内容 解析
- Oracle与Postgresql在PLSQL内事务回滚的重大差异
- Senior PHP development case (1) : use MYSQL statement across the table query cannot export all records of the solution
- Structure function exercise
- RSS订阅微信公众号初探-feed43
- How to systematically plan and learn software testing?
猜你喜欢

Take care of JVM performance optimization (own note version)

A Preliminary Study of RSS Subscription to WeChat Official Account-feed43

Basic characteristics of TL431 and oscillator circuit

7-2 LVS+DR概述与部署

42. 接雨水

JVM Notes

How to keep the source code confidential in the development under the burning scenario

How to systematically plan and learn software testing?

This Thursday evening at 19:00, the fourth live broadcast of knowledge empowerment丨The realization of equipment control of OpenHarmony smart home project

自定义通用分页标签02
随机推荐
This Thursday evening at 19:00, the fourth live broadcast of knowledge empowerment丨The realization of equipment control of OpenHarmony smart home project
Embedded database development programming MySQL (full)
【21天学习挑战赛】顺序查找
机器学习之视频学习【更新】
Jenkins export and import Job Pipeline
Oracle与Postgresql在PLSQL内事务回滚的重大差异
系统设计.如何设计一个秒杀系统(完整版 转)
怎么把elastic中的异常登录ip和日志自动导出或抓取到数据库中?
Converts XML tags to TXT format (voc conversion for yolo convenient training)
JVM笔记
马尔可夫链
21 days learning challenge 】 【 sequential search
mq应用场景介绍
Mini program + e-commerce, fun new retail
7-2 LVS+DR Overview and Deployment
TL431的基本特性以及振荡电路
10 Convolutional Neural Networks for Deep Learning 3
How to systematically plan and learn software testing?
7-1 LVS+NAT 负载均衡群集,NAT模式部署
"Introduction to nlp + actual combat: Chapter 8: Using Pytorch to realize handwritten digit recognition"