After 4 hours of unsuccessful attempts to set up tensorflow in Docker on Windows, I decided to – just for fun – try to run it in the shiny new Windows Subsystem for Linux on my Windows 10 Insider Preview Build 14332. What began with low expectations turned out to be very successful, so here are the steps:
First enable the Windows Subsystem for Linux in the “Turn Windows features on or off” dialog:
Then open the Ubuntu Bash and update the package index:
You can now proceed to install pip for Python 2:
sudo apt-get install python-pip python-dev
Now install the CPU-enabled Linux x64 tensorflow package::
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
Tensorflow is now installed. With the following command, you can get the directory of the installed package:
python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))'
This should give something like “/usr/local/lib/python2.7/dist-packages/tensorflow”.
Now let’s cd to the directory with the example implementation of a CNN for the MNIST dataset:
And run the convolutional neural network:
In the end, the run completed with a test set error of 0.8 %.
That’s it for now – have fun!