Friday, February 10, 2017

Installing tensorflow

This took 2 days. The issue was that I started out with pip install, which could impact the existing python (2.7) programs in the GPU box. I eventually went with virtualenv install.

Install required (some unrequired) packages

$ sudo apt-get install openjdk-8-jdk git python-dev python3-dev python-numpy python3-numpy build-essential python-pip python3-pip python-virtualenv swig python-wheel libcurl3-dev

Create a Virtualenv environment in the directory ~/tensorflow:

$ virtualenv --system-site-packages ~/tensorflow
 

Activate the environment:

$ source ~/tensorflow/bin/activate

(tensorflow)$ 

Pick the right tensorflow binary package (Ubuntu/Linux 64-bit, GPU enabled, Python 3.5)

(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp35-cp35m-linux_x86_64.whl


Install tensorflow
 
(tensorflow)$ pip3 install --upgrade $TF_BINARY_URL


Add commands to ~/.bash_profile

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda


Done!

No comments:

Post a Comment