Record the code using the GPU to run Tensorflow

Use conda create a new virtual environment

 

Input conda create -n intelligent-judge python = 3.6

Create a python version 3.6 name is intelligent-judge virtual environment

 

 

View card information

Enter lspci | grep -i vga graphics card to view information

 

 

 

 

 

 

 

It is clear that NVIDIA Quadro GP100

 

CUDA configuration and CUDNN

Was originally going to download cuda and cudnn the results of a look, on the server already has a ready-made

 

Entry

cat /usr/local/cuda/version.txt,

with

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

 

 

 

You can see cuda version is 9.0.176, cudnn is version 7.5.0

 

Therefore the corresponding version, decided to install tensorflow gpu-1.70version

 

Configuration package python in a virtual environment

 

Input source activate intelligent-judge activate the virtual environment

 

Input pip install tensorflow-gpu == 1.7.0

 

Successful installation

 

Test file from remote repository pull

 

 

 

Running problems

 

 

 

 

 

Tips can not find cuda

 

 

 

Adjusted in accordance with the following article

https://blog.csdn.net/qq_34374211/article/details/81018320

 

 

Successfully run the test file

 

Run training documents, but also out of the unitary moths

 

 

 

Check out the official API

 

 

 

 

The original is in the tf.random.normal tensorflow 1.7.0 should be replaced with tf.random_normal

 

After running change

 

 

 

 

 

He has begun training a pleasure

 

Guess you like

Origin www.cnblogs.com/I-AM-DUMBASS/p/11452747.html