TensorFlow installation
TensorFlow installation comes with two modes: CPU and GPU. We will start off the installation tutorial by installing TensorFlow in GPU mode.
TensorFlow GPU installation for Ubuntu 16.04
The GPU mode installation of TensorFlow requires an up-to-date installation of the NVIDIA drivers because the GPU version of TensorFlow only supports CUDA at the moment. The following section will take you through a step-by-step process of installing NVIDIA drivers and CUDA 8.
Installing NVIDIA drivers and CUDA 8
First off, you need to install the correct NVIDIA driver based on your GPU. I have a GeForce GTX 960M GPU, so I will go ahead and install nvidia-375
(if you have a different GPU, you can use the NVIDIA search tool http://www.nvidia.com/Download/index.aspx to help you find your correct driver version). If you want to know your machine's GPU, you can issue the following command in the terminal:
lspci | grep -i nvidia
You should get the following output in the terminal:

Next, we need...