当前位置:网站首页>Detailed steps for tensorflow-gpu2.4.1 installation and configuration
Detailed steps for tensorflow-gpu2.4.1 installation and configuration
2022-08-03 19:40:00 【AI Algorithm Alliance】
I. Machine environment
Graphics card: RTX3060
System: windows10
Second, tensorflow-gpu configuration environment
CUDA:11.1.1
cuDNN:8.1.1
Language: Python3.8.8
Deep learning framework: Tensorflow-gpu2.4.1, Keras2.4.3
III. Installation process
1. Install Visual studio 2017.Compile dependencies.Check Desktop development using C++ when selecting the workload.Download address: https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&rel=15
2. Install CUDA.The CUDA11.1.1 version is installed here.File name: cuda_11.1.1_456.81_win10.exe.There are about 3.1G.After downloading, double-click to install it. It is installed to the C drive by default and takes up little space.Download address: https://developer.nvidia.com/cuda-toolkit-archive
3. Download cudnn.An account login is required, if you don't have one, register one.The download here is cuDNN8.1.1.File name: cudnn-11.2-windows-x64-v8.1.1.33.zip.There are about 661M.After decompression, there are three folders bin, include, lib.Copy the files in the three folders to the corresponding folder in the CUDA installation directory.My CUDA installation directory is: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1.Take the bin folder as an example, copy all the files in the bin to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin.Download address: https://developer.nvidia.com/zh-cn/cudnn
The above three are installed and restart the computer.
4. Install python.Installed here is python3.8.8.File name: python-3.8.8-amd64.exe.About 27M.Download address: https://www.python.org/getit/
5. Install tensorflow-gpu.Install using pip.Command line: pip install tensorflow-gpu==2.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/ It is faster to install using Tsinghua image.
6. Install keras.Install using pip.Command line: pip install keras==2.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple/ It is faster to install using Tsinghua mirror.
Fourth, test.
import tensorflow as tfprint(tf.__version__)print(tf.test.is_built_with_cuda())print(tf.test.is_gpu_available())First, bug handling.
When testing print(tf.test.is_gpu_available()) print is False, prompt: Not creating XLA devices, tf_xla_enable_xla_devices not set
Workaround: Find cusolver64_11.dll in the bin folder of the CUDA installation directory and rename it to cusolver64_10.dll.After renaming, test again and find that print(tf.test.is_gpu_available()) prints True, but there is still a Not creating XLA devices, tf_xla_enable_xla_devices not set prompt.This does not affect usage.
Second, test print information description:
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
Graphics card information: NVIDIA GeForce RTX 3060, graphics card computing power: 8.6, GPU availability: True
tips:
a. Enter nvcc -V in the terminal to view the cuda version.
b. Enter nvidia-smi in the terminal to check the graphics card driver version, the highest supported cuda version, and the graphics card usage.
c.python IDE tool, I personally recommend PyCharm.
d. The installation process of other graphics cards is similar, but pay attention to the cuda version supported by the graphics card and the versions of cuda, cudnn, python, tensorflow, and keras.
边栏推荐
猜你喜欢
随机推荐
面试突击:什么是粘包和半包?怎么解决?
力扣刷题之移动零
【统计机器学习】线性回归模型
虚拟机vmware设置桥接模式上网
从腾讯阿里等大厂出来创业搞 Web3、元宇宙的人在搞什么
LeetCode 622. Designing Circular Queues
Execute the mysql script file in the docker mysql container and solve the garbled characters
Postgresql中的pg_memory_barrier_impl和C的volatile
基于DMS的数仓智能运维服务,知多少?
net-snmp编译报错:/usr/bin/ld: cannot find crti.o: No such file or directory
Internet Download Manager简介及下载安装包,IDM序列号注册问题解决方法
软件测试技术之如何编写测试用例(3)
Standard C language learning summary 11
Postgresql-xl全局快照与GTM代码走读(支线)
开源生态研究与实践| ChinaOSC
揭秘5名运维如何轻松管理数亿级流量系统
DeepMCP网络详解
安装anaconda并创建虚拟环境
京东云发布新一代分布式数据库StarDB 5.0
MySQL基础









