Tensorflow 0.12, Ubuntu16.04, CUDA 8

Task: install Tensorflow framework on Ubuntu 16.04 with CUDA 8.0

Update the system

  • Install build essentials:
    • sudo apt-get install build-essential
  • Install latest version of kernel headers:
    • sudo apt-get install linux-headers-uname -r

Install CUDA

  • Install curl (for the CUDA download):
    • sudo apt-get install curl
  • Download CUDA 8.0 to Downloads folder
  • Make the downloaded installer file runnable:
    • chmod +x cuda_8.0.44_linux.run
  • Run the CUDA installer:
    • sudo ./cuda_8.0.44_linux.run --kernel-source-path=/usr/src/linux-headers-`uname -r`/
      • Accept the EULA
      • Do NOT install the graphics card drivers (since we are in a virtual machine)
      • Install the toolkit (leave path at default)
      • Install symbolic link
      • Install samples (leave path at default)
  • Update the library path
    • echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
    • echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib' >> ~/.bashrc
    • source ~/.bashrc 

Install pip

  • Install pip:
    • sudo apt-get install python-pip python-dev

Install Tensorflow

  • Install Tensorflow:
    • pip install tensorflow

Test Tensorflow:

  • Test Tensorflow:
    • python
    • import tensor flow as tf

Congralutations!!! You have successfully installed Tensorflow into Ubuntu 16.04 with CUDA 8.0. Let’s enjoy it now.

Set up Visual Q & A code

 

 

 

CONDA
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-`uname -p`.sh
bash Miniconda-latest-Linux-`uname -p`.sh
source ~/.bashrc

Theano
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git curl
conda install -y theano
sudo apt-get install -y build-essential
pip uninstall theano
pip install git+git://github.com/Theano/Theano.git@master

H5py

conda install -y h5py

Keras
pip install keras

Test Keras
curl -sSL https://github.com/fchollet/keras/raw/master/examples/mnist_mlp.py | python