知行编程网知行编程网  2022-08-01 14:00 知行编程网 隐藏边栏 |   抢沙发  93 
文章评分 0 次,平均分 0.0

RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras

来自知乎   作者丨Yukyin
链接丨https://zhuanlan.zhihu.com/p/279401802
编辑丨极市平台
本文仅作学术分享,若侵权,请联系后台删文处理

导读:本文介绍了作者使用RTX3090进行深度学习环境配置pytorch、tensorflow、keras等的详细过程及代码。
笔者中山大学研究生,医学生+计科学生的集合体,机器学习爱好者。
最近刚入了3090,发现网上写的各种环境配置相当混乱而且速度很慢。所以自己测了下速度最快的3090配置环境,欢迎补充!
基本环境(整个流程大约需要5分钟甚至更少)

(1)官网下载,安装显卡驱动:

(2)安装Anaconda并换源

(3)创建虚拟环境,一般用py37或py38(以下都在虚拟环境中操作)


(4)安装cuda11.0和pytorch1.7(不用再conda install cudatoolkit==11.0)

(5)安装cudnn8(因为conda还不支持cudatoolkit=11中下载cudnn)
从https://developer.nvidia.com/rdp/cudnn-download下载cudnn,解压后进入cuda/lib64路径下,把里面所有文件拷入对应虚拟环境(exp38)的lib中

(6)装tf2.5(不要装tensorflow-gpu==2.4.0rc0,会报错'NoneType' object has no attribute 'TFE_MonitoringDeleteBuckets')

(7)装tf1.15.4
此处参考这位大佬的tf1.15.4安装步骤
https://blog.csdn.net/wu496963386/article/details/109583045?utm_medium=distribute.wap_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.wap_blog_relevant_pic

(8)装keras2.3


(9)测试(使用cuda10.2也可以测试使用gpu,但貌似不能把数据写入gpu)
RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras
pytorch
RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras
tensorflow-2.5或1.15.4
RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras
RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras
keras(测试需要改部分源码_get_available_gpus())
RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras
RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras

后记:实际3090需要cuda11.1,但pytorch和tf目前只支持11.0。而且讲真不需要单独配cuda、cudnn,在虚拟环境里搞就行了。
20210102更新:对tf1.15.4进行测试,实测可用,数据可写入gpu。文章中已补充。
<section data-brushtype="text" style="padding-right: 0em;padding-left: 0em;white-space: normal;font-size: 16px;letter-spacing: 0.544px;color: rgb(62, 62, 62);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;widows: 1;word-spacing: 2px;caret-color: rgb(255, 0, 0);text-align: center;"><strong style="color: rgb(0, 0, 0);font-family: -apple-system-font, system-ui, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;"><span style="letter-spacing: 0.5px;font-size: 14px;"><strong style="font-size: 16px;letter-spacing: 0.544px;"><span style="letter-spacing: 0.5px;">—</span></strong>完<strong style="font-size: 16px;letter-spacing: 0.544px;"><span style="letter-spacing: 0.5px;font-size: 14px;"><strong style="font-size: 16px;letter-spacing: 0.544px;"><span style="letter-spacing: 0.5px;">—</span></strong></span></strong></span></strong></section><pre style="color: rgb(86, 86, 86);font-size: 16px;letter-spacing: 1px;text-align: left;"><pre><section style="letter-spacing: 0.544px;white-space: normal;font-family: -apple-system-font, system-ui, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;"><section powered-by="xiumi.us"><section style="margin-top: 15px;margin-bottom: 25px;opacity: 0.8;"><section><section style="letter-spacing: 0.544px;"><section powered-by="xiumi.us"><section style="margin-top: 15px;margin-bottom: 25px;opacity: 0.8;"><section><section style="margin-bottom: 15px;padding-right: 0em;padding-left: 0em;color: rgb(127, 127, 127);font-size: 12px;font-family: sans-serif;line-height: 25.5938px;letter-spacing: 3px;text-align: center;"><span style="color: rgb(0, 0, 0);"><strong><span style="font-size: 16px;font-family: 微软雅黑;caret-color: red;">为您推荐</span></strong></span></section><p style="margin: 5px 16px;padding-right: 0em;padding-left: 0em;font-family: sans-serif;letter-spacing: 0px;opacity: 0.8;line-height: normal;text-align: center;">彻底搞懂机器学习中的正则化<br  /></p><section style="margin-top: 5px;margin-bottom: 5px;padding-right: 0em;padding-left: 0em;min-height: 1em;font-family: sans-serif;letter-spacing: 0px;opacity: 0.8;line-height: normal;text-align: center;">我在哥大读博的五年,万字总结<br  /></section><section style="margin-top: 5px;margin-bottom: 5px;padding-right: 0em;padding-left: 0em;min-height: 1em;font-family: sans-serif;letter-spacing: 0px;opacity: 0.8;line-height: normal;text-align: center;">一个算法工程师的日常是怎样的?</section><section style="margin-top: 5px;margin-bottom: 5px;padding-right: 0em;padding-left: 0em;min-height: 1em;font-family: sans-serif;letter-spacing: 0px;opacity: 0.8;line-height: normal;text-align: center;"><span style="font-size: 14px;">吴恩达上新:生成对抗网络(GAN)专项课程</span></section><section style="margin-top: 5px;margin-bottom: 5px;padding-right: 0em;padding-left: 0em;min-height: 1em;font-family: sans-serif;letter-spacing: 0px;opacity: 0.8;line-height: normal;text-align: center;">从SGD到NadaMax,十种优化算法原理及实现</section></section></section></section></section></section></section></section></section>

RTX 3090 的深度学习环境配置指南:Pytorch、TensorFlow、Keras

本篇文章来源于: 深度学习这件小事

本文为原创文章,版权归所有,欢迎分享本文,转载请保留出处!

知行编程网
知行编程网 关注:1    粉丝:1
这个人很懒,什么都没写

你可能也喜欢

热评文章

发表评论

表情 格式 链接 私密 签到
扫一扫二维码分享