Posted: 7 January 2016
I wanted to implement a neural network myself and see how it would work in finding Wally. Since Google released TensorFlow recently, and it seemed like a really good toolbox, I set out to install and use it.
It’s worth mentioning that TensorFlow is moving extremely quickly, so stuff on TensorFlow is actually very out dated. The GitHub source is the most updated. The wheels from pip install are very different from the one on GitHub. I raised an issue on GitHub and offered to fix it, but the main contributors said that they will release new wheels when there’s a new version. So for those who are confused as to how to get it to work, here’s a tutorial for you!
Only tried and tested on Ubuntu 14.04. Correct as of 7th January 2016.
Download bazel from here. Then go into the directory you’ve downloaded it and execute the code below. Of course, .sh file depends on which version you downloaded.
If you encounter a problem like set JAVA_HOME. Go to /etc/environment and add the following:
Following that, place Bazel in your path.
Clone TensorFlow into Directory.
Default is /usr/bin/python. Most of us would just put the default.
At this step, you would have thought that everything is nice and complete. After all, the next step is “Optional”. However, when we try and run perhaps /tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py, we get an error message that says: “No module named tensorflow.python.platform”
This happens because tensorflow has not been “pip installed”. Therefore, we have to build the wheel and then install it. Bazel now comes in handy. Note that you have to be in the tensorflow directory (the first one).
After this, it should be all done! But if you do encounter a problem, upgrading may fix it.
This should get TensorFlow up and running. Pardon the potentially ugly highlighted black boxes, I couldn’t get it to be simple black and white. It’s a CSS fix in future, but please bear with it for now :)