Linux installation TensorFlow (GPU version)

Source: Internet
Author: User

I. Installation of CUDA

Specific installation process See my other blog, ubuntu16.04 installation configuration deep learning environment

Second, installation TensorFlow

1. Specific installation process In fact, the official website is written in more detail, summed up the words can be divided into two types: Install release version and source code compiled installation. Because the source code compiled installation is cumbersome, and need to install Google's own compiler Bazel, so I choose to install the compiled.

2. When I wrote this blog, TensorFlow updated to 1.4.0, install the compiled version must look, because each version depends on the underlying library is not the same.

Install CUDA-8,CUDNN V6.0.,ibcupti-dev Library prior to 1.4.0 version installation

Note that the above software version, Cuda must be 8,CUDNN 6.0 (I was 1.2.0, then CUDNN is v5.1 on the line, so this version is very important, if your CUDNN version is too low will be an error: Importerror: Libcudnn.so.6:cannot open Shared object file:no such file or directory)

Install Bcupti-dev Library Executable

sudo apt-get install Libcupti-dev

3. When the above environment is ready, the installation is very simple

If you are using Anaconda, the installation steps are as follows:

Conda create-n tensorflow python=2.7 # or python=3.3, etc.
SOURCE Activate TensorFlow
Pip Install--ignore-installed--upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_ Gpu-1.4.0-cp35-cp35m-linux_x86_64.whl

If Python is installed directly:
First you need Pip, if not, you can use the following command to install
sudo apt-get install python-pip python-dev   # for Python 2.7sudo apt-get install python3-pip python3-dev # for Python 3.N

Install TensorFlow using PIP below

$ pip install tensorflow # Python 2.7; CPU Support (no GPU support)

$ PIP3 Install TensorFlow # Python 3.N; CPU Support (no GPU support)

$ pip install Tensorflow-gpu # Python 2.7; GPU Support

$ PIP3 Install Tensorflow-gpu # Python 3.N; GPU Support

No version of the default is the latest version, if you want to a specific version can be added after TensorFlow version number, such as the first can be written as pip install TensorFlow-1.1.0

Third, test TensorFlow whether the installation is successful

After 122 steps, it should be installed successfully, can write a tensorflow small program test

# Python Import  = tf.constant ('Hello, tensorflow! '  = TF. Session ()print(sess.run (hello))

Linux installation TensorFlow (GPU version)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.