Installing Tensorflow on Windows using WSL / Bash on Ubuntu on Windows

After installing Windows Subsystem for Linux, aka Bash on Ubuntu on Windows, I just had to test if Tensorflow worked. And it does, after a fashion.

Basically you need follow this Virtualenv guide official user guide. I haven’t tried GPU installation yet, but I doubt it will work.

# Get python, pip and virtualenv installed
sudo apt-get install python-pip python-dev python-virtualenv
# Setup virtualenv
virtualenv --system-site-packages ~/tensorflow
# Activate virtualenv
source ~/tensorflow/bin/activate
# Set installation
# Do installation
pip install --upgrade $TF_BINARY_URL
# Do your stuff!
# Deactivate virtualenv once done

To run an example:

cd ~/tensorflow/lib/python2.7/site-packages/tensorflow/models/image/mnist/
# Wait a zillion years until your network is trained...

To run again:

# Activate virtualenv
source ~/tensorflow/bin/activate
# do you stuff!
# Deactivate virtualenv once done

Happy days!