Deep Learning with TensorFlow(Second Edition)
上QQ阅读APP看书,第一时间看更新

Installing and configuring TensorFlow

You can install and use TensorFlow on a number of platforms such as Linux, macOS, and Windows. Moreover, you can also build and install TensorFlow from the latest GitHub source of TensorFlow. Furthermore, if you have a Windows machine, you can install TensorFlow via native pip or Anacondas. TensorFlow supports Python 3.5.x and 3.6.x on Windows.

In addition, Python 3 comes with the pip3 package manager, which is the program you will use to install TensorFlow. Therefore, you do not need to install pip if you are using this Python version. From our experience, even if you have NVIDIA GPU hardware integrated on your machine, it would be worth installing and trying the CPU-only version first and if you don't experience good performance, you should switch to GPU support then.

The GPU–enabled version of TensorFlow has several requirements such as 64–bit Linux, Python 2.7 (or 3.3+ for Python 3), NVIDIA CUDA® 7.5 or higher (CUDA 8.0 required for Pascal GPUs), and NVIDIA cuDNN (this is GPU accelerated deep learning) v5.1 (or higher is recommended). See more at https://developer.nvidia.com/cudnn.

More specifically, the current development of TensorFlow supports only GPU computing using NVIDIA toolkits and software. Therefore, the following software must have to be installed on your machine to get the GPU support on your predictive analytics applications:

  • NVIDIA driver
  • CUDA with compute capability >= 3.0
  • CudNN

The NVIDIA CUDA toolkit includes (see more at https://developer.nvidia.com/cuda-zone):

  • GPU–accelerated libraries such as cuFFT for FFT
  • cuBLAS for Basic Linear Algebra Subroutines (BLAS)
  • cuSPARSE for sparse matrix routines
  • cuSOLVER for dense and sparse direct solvers
  • cuRAND for random number generation, NPP for image, and video processing primitives
  • nvGRAPH for NVIDIA Graph Analytics Library
  • Thrust for templated parallel algorithms and data structures and a dedicated CUDA math library

However, we will not cover the installation and configuration of TensorFlow since the documentation provided on TensorFlow is very rich to be followed and acted accordingly. Another reason is that the version will be changed periodically. Therefore, keeping yourself updated with the TensorFlow website https://www.tensorflow.org/install/ will be a better idea.

If you have already installed and configured your programming environment, let us dive into TensorFlow computation graph.