当前位置:网站首页>tensorflow-gpu2.4.1安装配置详细步骤
tensorflow-gpu2.4.1安装配置详细步骤
2022-08-03 19:35:00 【AI算法联盟】
一、机器环境
显卡:RTX3060
系统:windows10
二、tensorflow-gpu配置环境
CUDA:11.1.1
cuDNN:8.1.1
语言:Python3.8.8
深度学习框架:Tensorflow-gpu2.4.1、Keras2.4.3
三、安装流程
1.安装Visual studio 2017。编译依赖。选择工作负载时勾选使用C++的桌面开发。下载地址:https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&rel=15
2.安装CUDA。这里安装的是CUDA11.1.1版本。文件名:cuda_11.1.1_456.81_win10.exe。大约有3.1G。下载好双击安装即可,默认安装到c盘,占用空间不大。下载地址:https://developer.nvidia.com/cuda-toolkit-archive
3.下载cudnn。需要账号登录,没有就注册一个。这里下载的是cuDNN8.1.1。文件名:cudnn-11.2-windows-x64-v8.1.1.33.zip。大约有661M。解压后有三个文件夹bin、include、lib。把三个文件夹里面的文件复制到CUDA安装目录对应的文件夹里。我的CUDA安装目录为:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1。以bin文件夹为例,把bin里面的所有文件复制到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin中。下载地址:https://developer.nvidia.com/zh-cn/cudnn
上面三个安装好重启电脑。
4.安装python。这里安装的是python3.8.8。文件名:python-3.8.8-amd64.exe。大约27M。下载地址:https://www.python.org/getit/
5.安装tensorflow-gpu。使用pip安装。命令行:pip install tensorflow-gpu==2.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 使用清华镜像安装更快。
6.安装keras。使用pip安装。命令行:pip install keras==2.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 使用清华镜像安装更快。
四、测试。
import tensorflow as tf
print(tf.__version__)
print(tf.test.is_built_with_cuda())
print(tf.test.is_gpu_available())
一、bug处理。
测试时遇到print(tf.test.is_gpu_available())打印是False,提示:Not creating XLA devices, tf_xla_enable_xla_devices not set
解决方法:在CUDA安装目录的bin文件夹下找到cusolver64_11.dll,将其重命名为cusolver64_10.dll。重命名后再次测试发现print(tf.test.is_gpu_available())打印为True,但还是有Not creating XLA devices, tf_xla_enable_xla_devices not set提示。这个不影响使用。
二、测试打印信息说明:
Created TensorFlow device (/device:GPU:0 with 10491 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3060, pci bus id: 0000:01:00.0, compute capability: 8.6)
True
显卡信息:NVIDIA GeForce RTX 3060,显卡算力:8.6,GPU是否可用:True
tips:
a.在终端输入nvcc -V 查看cuda版本。
b.在终端输入nvidia-smi查看显卡驱动版本、支持的最高cuda版本、显卡使用情况。
c.python IDE工具,个人推荐使用PyCharm。
d.其他显卡安装过程类似,但注意显卡支持的cuda版本及cuda、cudnn、python、tensorflow、keras的版本要对应上。
边栏推荐
- Matlab论文插图绘制模板第42期—气泡矩阵图(相关系数矩阵图)
- 【夜莺监控方案】08-监控msyql集群(prometheuse+n9e+mysqld_exporter)
- Postgresql中的pg_memory_barrier_impl和C的volatile
- 网络协议-TCP、UDP区别及TCP三次握手、四次挥手
- CentOS 7 安装mysql
- MySQL详细学习教程(建议收藏)
- Unity gets the actual coordinates of the ui on the screen under the canvas
- Execute the mysql script file in the docker mysql container and solve the garbled characters
- MYSQL误删数据恢复
- 花 30 美金请 AI 画家弄了个 logo,网友:画得非常好,下次别画了!
猜你喜欢
随机推荐
钱江摩托某型号产品ECU货不对版 消费者知情权应如何保障?
MySQL基础
读取 resources 目录下的文件路径的九种方式,你知道多少?
丙二醇二乙酸酯(Propylene Glycol Diacetate)
The addition and subtraction of the score of the force deduction brush question (a daily question 7/27)
ECCV 2022 Oral | 满分论文!视频实例分割新SOTA: IDOL
国产虚拟化云宏CNware WinStack安装体验-5 开启集群HA
七夕之前,终于整出了带AI的美丽秘笈
SQL server 实现触发器备份表数据
基础软件与开发语言开源论坛| ChinaOSC
Shell programming loop statement
Postgresql中的pg_memory_barrier_impl和C的volatile
高效目标检测:动态候选较大程度提升检测精度(附论文下载)
基于DMS的数仓智能运维服务,知多少?
小马智行起诉擎天智卡:索赔6000万 彭军称要斗争到底
Shell编程之循环语句
关于2022年度深圳市技术攻关重大项目的申报通知
普通用户如何利用小红书赚钱呢?小红书的流量是真的吗?
Radondb mysql installation problems
【leetcode】剑指 Offer II 009. 乘积小于 K 的子数组(滑动窗口、双指针)









