项目作者: SmileTM

项目描述 :
Tensorflow2.0-GPU-CUDA9.0
高级语言:
项目地址: git://github.com/SmileTM/Tensorflow2.X-GPU-CUDA9.0.git
创建时间: 2020-01-05T13:32:46Z
项目社区:https://github.com/SmileTM/Tensorflow2.X-GPU-CUDA9.0

开源协议:

下载


Tensorflow2.X-GPU-CUDA9.0

Tensorflow2.X-GPU-CUDA9.0

This Tensorflow2.X-GPU-CUDA9.0 is bazeled from the sorce code of Google.

Install

If you have configured cuda9 and cudnn in your .bashrc, you can skip to Third step.

First

Create cuda9.0 environment by conda

  1. conda create -n cuda9.0
  2. conda activate cuda9.0
  3. conda install cudatoolkit=9.0 cudnn=7.6.0 cupti

Second

Add dependency in .bashrc

Use conda env list find the path of cuda9.0

  1. conda env list
  1. (tf2) wxy@sait:~$ conda info -e
  2. # conda environments:
  3. #
  4. cuda9.0 /disk1/lx/conda/envs/cuda9.0
  5. mk /disk1/lx/conda/envs/mk

change the CONDA_ENV to your path of cuda9.0

add the following three lines of code in .bashrc

  1. vim ~/.bashrc
  1. export CONDA_ENV="/disk1/lx/conda/envs/cuda9.0"
  2. export CUDA_HOME="$CUDA_HOME:$CONDA_ENV/lib"
  3. export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_ENV/lib"

Then source .bashrc in you terminal.

  1. source ~/.bashrc

Third

Download and unzip the .whl file

Google-drive: tensorflow2.1-gpu-cudn9.0-py3.7

Google-drive: tensorflow2.0-gpu-cudn9.0-py3.7

Google-drive: tensorflow2.0-gpu-cudn9.0-py3.6

Google-drive: tensorflow2.0-gpu-cudn9.0-py3.5

Create a new env in conda(you can change test to your like)

  1. conda create -n test python=3.7
  2. conda activate test
  3. pip install tensorflow-2.0.0-cp37-cp37m-linux_x86_64.whl

Test

  1. python
  2. import tensorflow as tf
  3. tf.test.is_gpu_available()

If it shows True, congratulations.

Error

  1. W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.9.0';.....undefined symbol: GOMP_critical_end;

If you have this error, please add follow code in your code.

  1. import tensorflow as tf
  2. import ctypes
  3. ctypes.CDLL("libgomp.so.1", mode=ctypes.RTLD_GLOBAL)
  4. tf.test.is_gpu_available()

If it works , please give me a star.

Thank you!

How to install tensorflow2.X-GPU in your cuda version?

you need to bazel from the source code of tensorflow in your machine.

Reference

SmileTM Blog

How to install tensorflow2.0 in cuda9?