***This is an extremely optional tutorial, for installing TensorFlow. If you have Mac or Linux, you do not need this tutorial, just go to TensorFlow.org > get started > pip installation. You have just a few commands to run and you're all set. For people with Windows, you will need to use either Docker or a virtual machine to install TensorFlow. I am choosing a virtual machine due to its ease, and later will probably be using a dual boot instead.***
For setup, TensorFlow is supported by Mac and Linux, but not Windows. You can use their Docker distribution on Windows if you wanted.
You are free to use whatever setup you want, but I am personally going to be using Ubuntu 16.04, on a Virtual Machine, on my Windows machine. At the moment, it is still relatively unclear about what platform people will be executing their machine learning models on, so who knows what sort of operating system will become king in the end for this field. Feel free to use whatever method you want to use, it should not matter for a while, but I will still briefly run through the setup of the virtual machine.
First, Download Virtualbox. This will allow you to virtualize your various components like partioning off some CPU, GPU, and drive space. Next, you need an operating system. I choose Ubuntu 16.04 64bit. If you have a 64bit processor, then you can run a 64bit image, BUT you will need to most likely enable hardware virtualization within your BIOS settings, which will be found obviously in your BIOS settings, and under the CPU section. Every motherboard is different, so I can't be any more specific than that. Just poke around in settings and advanced settings, looking for CPU setting options.
Once you have the VirtualBox software, and the image of the operating system you want to use, click "new" within VirtualBox, name your new machine, choose the type and version of your operating system, and go to the next options.
If you want to see me go through the options in real-time, you can watch the video. The setup is very straight-forward, however. Choose a fixed-size harddrive, something at least 20+GB. I chose 50. VDI. Choose something adequate for memory. You will still need some memory left over for your host machine, so don't take it all.
Once you are done there, you can double click on the virtualbox to try to start it up, and you should get a message that there is nothing to boot, nor anything in a boot drive. From here, you can select your recently downloaded Ubuntu install image, and begin the installation process. When installing, you will get to a point about whether or not you want to erase harddrive contents and replace with Ubuntu. As uncomfortable as that might feel, the answer is yes, that is what you want to do. This will clean install on your virtual harddrive, not your actual one.
Once the installation is complete, you will be prompted to reset the virtualbox. Restarting with prompt didnt seem to do much for me, so you can either close the window to power down, or right click your virtualbox from the GUI and choose to or shut down.
When you have turned off your virtual machine, you can right click it, and go into the settings. While there, go into the system, and assign yourself more than the default number of cpus (1). These will only be allocated to your virtual machine when it is on, not all of the time. You may also want to give yourself some more video memory.
Now boot things up, and you have probably noticed that you're not getting a very great resolution. You can run the following to enable a resize-able screen:
sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms
Now, we're ready to get TensorFlow installed on our machine. You will also need Python3, but this comes with Ubuntu 16.04 already. Head to TensorFlow.org, click on get started, and then on "pip installation" on the side bar. Things may be different if you are viewing this tutorial later on. I will do my best to update this text-based version as things change, however. So, on the pip installation page, the instructions first have us running:
$ sudo apt-get install python3-pip python3-dev
The above is run in your terminal. On Ubuntu, you can press ctrl+alt+t to make this come up in the GUI desktop. Since I am running a 64 bit version of Linux (Ubuntu), have Python 3.5, and want the CPU version, I choose:
# Ubuntu/Linux 64-bit, CPU only, Python 3.5 $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
$ sudo pip3 install --upgrade $TF_BINARY_URL
And we're done. To test, we can type python3 in the console, and try to import tensorflow. If that works, we're all set!
I will be using Sublime Text to edit the Python files. Use whatever you like. On Ubuntu, once you download the .deb file, you need to run:
sudo dpkg -i /path/to/deb/file and then
sudo apt-get install -f
In the next tutorial, we're going to cover the basics of working with TensorFlow.