All Articles

TensorFlow Lightning Talk

Introduction

This is a quick introduction to TensorFlow. It was Created for a Lightning Talk given to a Deep Learning Study Group. We are all taking the Coursera Specialization on Deep Learning

Soon after starting the Coursera DL Course I was also finding references to TensorFlow and started watching some YouTube videos talking about Tensorflow. At the time I was unaware that the course would use TensorFlow.

Deep Learning Frameworks

DL libraries rank jpg 768x981

The table above was taken from this article: Ranking Popular Deep Learning Libraries for Data Science had TensoFlow way out in the lead:

Keras was 2nd. Keras is not really a competing framework but a higher level library that can integrate with TF. Last year the author of Keras Francois Chollet announced that Keras would be added to TF

TensorFlow in 5 minutes

Execution Model

This O’Reilly Article explains the TC execution model. It’s a delayed execution model. In TF you define a graph then run it.

Delayed Execution has it’s detractors and maybe Google is listening because there are efforts to support eager execution in TF.

I do not consider myself an advanced programmer but I don’t find the Delayed Execution model that daunting. But perhaps thats because I use Tableau!

Why Tensorflow?

What makes TensorFlow so popular? I don’t know! I have not even looked at any of the other Libraries but I suspect the depth and breadth, performance, and community have a lot to do with it. I get the impression TensorFlow is democratising Deep Learning.

BTW AWS adopted MXNet and proposed it as an Apache Incubator project). Microsoft seems to be using CNTK or Cognative Toolkit

Tensorboard

TensorBoard provides a way to vizualize Deep Learning. Here is a YouTube Introduction.

As a Tabloid you might be interested in seeing how data vizualization can be applied to help understand complicated processes.

Installing TensorFlow in a Windows Lab PC with a GPU

PC

My Home Lab server not state of the art. It is a 2013 Intel i7 six core with 64GB of memory running Windows 2012. It did not have a great graphics card.

Which GPU to Buy a GPU

GPUs can be expensive. All the Bitminers are buying them up so the prices are inflated. But for learning Tensorflow a budget GPU can provide significant improvement over a CPU only setup even a six core.

This blog post by Tim Dettmers has a good overview of the available GPUs as of April 2017 and his experiences with some configurations.

I bought an EVGA 1050 Ti from Amazon

The 1050Ti is a Pascal based GPU.

NVidia is best for Tensorflow because It cost me $160 new in November 2017. When I checked on January 31st it is selling used for $181

amazon gtx1050 page

[Show screenshot of CPU training v GPU training]

Installing Tensorflow and Prequisite Software

I followed the instructions from the Tensorflow site.

After installing your GPU Card:

  • Python Anaconda
  • NVidia CUDA
  • NVidia Drivers
  • cuDNN
  • TensorFlow

Comparing CPU v GPU

Here is the cifar10_train.py running on my GPU:

 cifar10 train gpu task manager

Note that I am getting over 3K examples as second or each batch is taking 0.039 seconds and my CPU is not running that much.

If I switch to the cpu version I get a very different performance.

An Example Application of Tensorflow

Donkey Car

Donkey Car

The Donkey Car platform is DIY Autonomous Remote Control (RC) car driven by a Raspberry PI and trained using Tensorflow/Keras. The project was created by Willam Roscoe and Adam Conway.

Where does DL and Tensorflow come in?

The car is a modified hobby RC car with a camera and Raspberry Pi added to provide the autonomous smarts. The car is trained by driving the car around a track, capturing the video then training a DL netowrk using Keras/Tensorflow. The actual trainng is done on a host PC then the trained network is transferred back to the Raspberry Pi. A well trained car can then drive around the track without human intervention.

You can get more details from the Donkey Car Home Page

Published 31 Jan 2018

I am an Enterprise Architect in the Customer Consulting organization at Tableau.
Robin Cottiss on Twitter