Google just released a fantastic-looking deep learning library called TensorFlow, complete with tutorials, and model-zoo-like examples.

Fortunately, the framework is very reminiscent of Theano, and has a Python front-end over a computation graph construction machine in C++ / CUDA (no OpenCL as far as I can tell).

These instructions are straight off Google’s Installation page, but work-for-me :

Create a VirtualEnv

virtualenv  --system-site-packages ~/tensorflow
. ~/tensorflow/bin/activate

CPU Version (11Mb download)

pip install --upgrade

GPU Version (50Mb download)

(a 1 character difference…)

pip install --upgrade

Test it on MNIST

NB : This downloads about 13Mb of MNIST data files, if they’re missing (likely on first run) :

python ~/tensorflow/lib/python2.7/site-packages/tensorflow/models/image/mnist/

GPU Issues : TensorFlow really wants cuDNN v6.5 (not v7.0)

If you get something like :

I tensorflow/stream_executor/cuda/] Unable to load cuDNN DSO.

… you haven’t got cuDNN installed like TensorFlow expects.

Uncompress and copy the cudnn files into the toolkit directory. Assuming the toolkit is installed in /usr/local/cuda:

tar xvzf cudnn-6.5-linux-x64-v2.tgz
sudo cp cudnn-6.5-linux-x64-v2/cudnn.h /usr/local/cuda/include
sudo cp cudnn-6.5-linux-x64-v2/libcudnn* /usr/local/cuda/lib64

Martin Andrews

{Finance, Software, AI} entrepreneur, living in Singapore with my family.

blog comments powered by Disqus