当前位置:网站首页>深度学习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 退出
至此,环境配置应该。。差不多。。搞完了吧。。。
深受毒害!!!
边栏推荐
- Stop behind.
- 七夕节,我用代码制作了表白信封
- See how DevExpress enriches chart styles and how it empowers fund companies to innovate their business
- 7.LVS负载均衡群集之原理叙述
- 大型连锁百货运维审计用什么软件好?有哪些功能?
- 【 observe 】 super fusion: the first mention of "calculate net nine order" evaluation model, build open prosperity of power network
- There is an 8 hour difference between the docker installation of mysql and the host.
- XSS related knowledge points
- Tensors - Application Cases
- 数组相关 内容 解析
猜你喜欢

深度学习——以CNN服装图像分类为例,探讨怎样评价神经网络模型

结构体函数练习

mq应用场景介绍

7-3 LVS+Keepalived Cluster Description and Deployment

十一种概率分布

2022杭电多校联赛第五场 题解
SQL injection in #, - +, - % 20, % 23 is what mean?

Significant differences between Oracle and Postgresql in PLSQL transaction rollback

7-2 LVS+DR Overview and Deployment

自定义通用分页标签01
随机推荐
【Ryerson情感说话/歌唱视听数据集(RAVDESS) 】
"Introduction to nlp + actual combat: Chapter 8: Using Pytorch to realize handwritten digit recognition"
How to dynamically add script dependent scripts
share总结
if,case,for,while
技术解析|如何将 Pulsar 数据快速且无缝接入 Apache Doris
文件系统的简单操作
Explain详解与实践
Jenkins 导出、导入 Job Pipeline
if,case,for,while
Introduction to mq application scenarios
drools从下载到postman请求成功
烧录场景下开发如何进行源代码保密工作
小程序 + 电商,玩转新零售
数组相关 内容 解析
八年软件测试工程师带你了解-测试岗进阶之路
2003. 每棵子树内缺失的最小基因值 DFS
8.Haproxy 搭建Web集群
自定义通用分页标签01
【C语言进阶】程序环境和预处理