Installing TensorFlow for Deep Learning - OPTIONAL




I will leave this tutorial here for people who want to use a virtual machine. At the time of this tutorial, TensorFlow was not supported on Windows, but now it is. If you want to install the CPU version of TensorFlow, it is as simple as a pip install tensorflow. If you want to install the GPU version of TensorFlow, you can check out:

Installing GPU TensorFlow on Linux

Installing GPU TensorFlow on Windows

The old tutorial for using a virtual machine on Windows with TensorFlow:

***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.***

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

Next, run:

$ 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.

The next tutorial:





  • Practical Machine Learning Tutorial with Python Introduction
  • Regression - Intro and Data
  • Regression - Features and Labels
  • Regression - Training and Testing
  • Regression - Forecasting and Predicting
  • Pickling and Scaling
  • Regression - Theory and how it works
  • Regression - How to program the Best Fit Slope
  • Regression - How to program the Best Fit Line
  • Regression - R Squared and Coefficient of Determination Theory
  • Regression - How to Program R Squared
  • Creating Sample Data for Testing
  • Classification Intro with K Nearest Neighbors
  • Applying K Nearest Neighbors to Data
  • Euclidean Distance theory
  • Creating a K Nearest Neighbors Classifer from scratch
  • Creating a K Nearest Neighbors Classifer from scratch part 2
  • Testing our K Nearest Neighbors classifier
  • Final thoughts on K Nearest Neighbors
  • Support Vector Machine introduction
  • Vector Basics
  • Support Vector Assertions
  • Support Vector Machine Fundamentals
  • Constraint Optimization with Support Vector Machine
  • Beginning SVM from Scratch in Python
  • Support Vector Machine Optimization in Python
  • Support Vector Machine Optimization in Python part 2
  • Visualization and Predicting with our Custom SVM
  • Kernels Introduction
  • Why Kernels
  • Soft Margin Support Vector Machine
  • Kernels, Soft Margin SVM, and Quadratic Programming with Python and CVXOPT
  • Support Vector Machine Parameters
  • Machine Learning - Clustering Introduction
  • Handling Non-Numerical Data for Machine Learning
  • K-Means with Titanic Dataset
  • K-Means from Scratch in Python
  • Finishing K-Means from Scratch in Python
  • Hierarchical Clustering with Mean Shift Introduction
  • Mean Shift applied to Titanic Dataset
  • Mean Shift algorithm from scratch in Python
  • Dynamically Weighted Bandwidth for Mean Shift
  • Introduction to Neural Networks
  • Installing TensorFlow for Deep Learning - OPTIONAL
  • Introduction to Deep Learning with TensorFlow
  • Deep Learning with TensorFlow - Creating the Neural Network Model
  • Deep Learning with TensorFlow - How the Network will run
  • Deep Learning with our own Data
  • Simple Preprocessing Language Data for Deep Learning
  • Training and Testing on our Data for Deep Learning
  • 10K samples compared to 1.6 million samples with Deep Learning
  • How to use CUDA and the GPU Version of Tensorflow for Deep Learning
  • Recurrent Neural Network (RNN) basics and the Long Short Term Memory (LSTM) cell
  • RNN w/ LSTM cell example in TensorFlow and Python
  • Convolutional Neural Network (CNN) basics
  • Convolutional Neural Network CNN with TensorFlow tutorial
  • TFLearn - High Level Abstraction Layer for TensorFlow Tutorial
  • Using a 3D Convolutional Neural Network on medical imaging data (CT Scans) for Kaggle
  • Classifying Cats vs Dogs with a Convolutional Neural Network on Kaggle
  • Using a neural network to solve OpenAI's CartPole balancing environment