当前位置:网站首页>Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)
Install the CPU version of tensorflow+cuda+cudnn (ultra detailed)
2022-07-05 08:46:00 【m0_ forty-six million ninety-three thousand eight hundred and t】
Purpose : install GPU Version of tensorflow

One 、 Check out the NVIDIA Does the version support CUDA And configurable CUDA edition
Method :
Right click in a blank space on the desktop , Open NVIDIA control panel , If you can't find it, you can refer to the following website win10 nvidia How to open the control panel ,win10 nvidia Control panel opening steps - Chinese cabbage u Disk start (dabaicai.com)
After opening , Click on the bottom left corner “ system information ”, Click again “ Components ”, notice NVCUDA.DLL Version shown later

You can see that my computer supports CUDA Of , And the highest version supports 11.4.94( Downward compatible ), At this time, I actually download <=11.4.94 Of CUDA All versions are available , Because downward compatibility . But you can also match it with the official website :
First check my graphics card version :

Go again CUDA Check the version correspondence on the official website : Release Notes :: CUDA Toolkit Documentation

Then you can see that my graphics card version is 471.41, So I can download CUDA11.4 update4 Following CUDA.( Backwards compatible ) If I want to download the above version , Then I can try to update my graphics card driver ( If it is already the latest , There's nothing we can do about it ) Update driver : Official Drivers | NVIDIA
Additional description : I'm really Xiaobai , At that time, I didn't know how to find this version comparison when searching by myself , Even if you enter the official website, you can't find , Although many people have given links , But I still want to find it by myself , So the search process is attached below
1. Enter CUDA Official website , Then select the document ( Because I'm looking for version comparison , So I'll check the document and try )

2. Get into NVIDIA CUDA Tooklkit(CUDA tool kit )

3,

thus , Finally found
Two 、 Confirm your installation tensorflow type
For example, I want to install tensorflow_gpu_1.15.0
Then tensorflow Official website stay Windows Build from source code in the environment | TensorFlow
Check the supported CUDA and CUDNN Version of

3、 ... and 、 install CUDA
Please see what you need TENSORFLOW model , And the environment it needs !
Because I want to install tensorflow_gpu_1.15.0, It supports CUDA The version is 7.4,CUDNN The version is 10, So I need to CUDA Download on 7.4 Version of , The method is as follows :
Enter... In search engine CUDA+ Version number



When the download is complete , Open setup , Choose where you want to install , Can be installed
Then agree and continue



Note here that if the current version is higher than the new version , Then uncheck , Otherwise installation will fail 
Configure environment variables
Right click on my computer stand alone --> attribute


Check whether there are two environment variables in the figure below , There is no need to match , Because I have , So I don't know how to solve it , Therefore, if there is no partner, you need to search separately 
thus CUDA10.0 It is installed , Verify that the installation was successful :
First step : Press... On the keyboard at the same time “windows key +R”, Input “cmd” And return , Get into windows Command line interface .
The second step : Input from the command line “nvcc -V” And return
The third step : If installed successfully CUDA Words , Will be displayed CUDA Version number of .

Four 、 install CUDNN
CUDNN download :cuDNN Archive | NVIDIA Developer
Because I want to download tensorflow adapter 7.4 Version of CUDNN, So I download 7.4.1 Version of CUDNN
When the download is complete , Unzip downloaded cuDNN Compressed package , Copy the files to CUDA In the folder

At this time, if you want to check your CUDNN Is the installation successful , Then you can get to The following table of contents , Find out if there is cudnn.h file , If there is , It means your cudnn Installation is successful
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include

If you want to continue to check the version you installed , Open the above cudnn.h file , Find the following code , On behalf of you cudnn The version is 7.4.1

5、 ... and 、 install anaconda
I have installed on my computer before anaconda, Therefore, the installation process will not be put here , Partners in need need also need to use their small hands to search .
6、 ... and 、 use ANACONDA install TENSORFLOW
1) stay ANACONDA Create a file named TENSORFLOW Environment ( You can call him any name , Here I call this environment TENSORFLOW.
conda create -n tensorflow pip python=3.6here pip python=3.6 In the name of tensorflow The build version in the environment of is 3.6 Of python.
2) Activate the environment
conda activate tensorflow ( To deactivate the environment and delete the environment, use the following two lines of code )
conda deactivate
conda env remove -n tensorflow3) install tensorflow-gpu 1.15 edition
pip install --user tensorflow-gpu==1.15 -i https://pypi.tuna.tsinghua.edu.cn/simple The display shows that the interface instructions are installed 
4) The detection is successful
Enter python, Then enter the following code to test
import tensorflow as tf
print('GPU', tf.test.is_gpu_available())If the following interface is displayed, the installation is successful

Now it's done !
Thank you, blogger :
Win10 install CUDA+cuDNN+TensorFlow-GPU Firefly
Anaconda Lower installation tensorflow1.15 Process record - You know
边栏推荐
猜你喜欢

Halcon Chinese character recognition

Illustration of eight classic pointer written test questions

leetcode - 445. Add two numbers II

Meizu Bluetooth remote control temperature and humidity access homeassistant

TypeScript手把手教程,简单易懂

深度学习模型与湿实验的结合,有望用于代谢通量分析

Business modeling of software model | vision

Guess riddles (10)

Guess riddles (4)

猜谜语啦(11)
随机推荐
MPSoC QSPI Flash 升级办法
Run菜单解析
Guess riddles (7)
STM32 lights up the 1.8-inch screen under Arduino IDE
Digital analog 2: integer programming
Lori remote control commissioning record
696. Count binary substring
Halcon snap, get the area and position of coins
Halcon Chinese character recognition
Adaboost使用
Pytorch entry record
Shift operation of complement
Redis实现高性能的全文搜索引擎---RediSearch
Tips 1: Web video playback code
Daily question - input a date and output the day of the year
Lori remote control LEGO motor
Arrangement of some library files
Task failed task_ 1641530057069_ 0002_ m_ 000000
【NOI模拟赛】汁树(树形DP)
ABC#237 C