Cats Versus Dogs – Deep Learning Introduction


Get the introductory slide deck here:
Deep Learning – Convoluted Neural Networks

Relevant code is here:

Cat or Dog

Presentation 2 Update:

Slides: CNN_Rockville2018 -2

Code: Talk 2 Slides

This code will require Tensorflow 1.5 and requisite libraries, which are referred to in the slides. The code is python, but is wrapped in Jyupiter notebooks so you will need to get that. When you are ready, you can get some data sets here:

You can grab datasets from here:


Installation – From Scratch

You will need Jupyter which requires Python 3, and you will need Tensorflow, which requires a 64-bit version of python. So start by installing python 3 64-bit:

Note the button on Python’s homepage defaults to a installing a 32-bit version of python.

With Python3 – 64-bit installed, install the needed libraries:

pip3 install jupyter


pip3 install --upgrade tensorflow-gpu


pip3 install --upgrade tensorflow


Note, the GPU version adds exponential speed, but required additional installations steps. Specifically:

That says as long as you have one of these GPUs:

You can install the needed CUDA Toolkit software:
Note, you need exactly 9.0 not 9.1 for tensorflow 1.5

Then, for the GPU you need cuDNN v7.0.5 for CUDA 9.0

Extract it somewhere, and add the /cuda/bin folder to the path.

I then had to add C:/Path/To/NVIDA/bin to my system PATH

So I would stop getting an import error in python3 for:

import tensorflow as tf

which you should run in python to make sure it’s working. Next install other python libraries:

pip3 install h5py

pip3 install keras

python -mpip install -U matplotlib

Now from command line, change directory to location of your files:


cd C:/PATH/TO/Cat-or-Dog

now start the Jupyter Notebook, to interact with the .ipynb files that hold the code:

jupyter notebook

This will launch a local server and open a browser tab. Select the first file “Dogs vs Cats – Train a Model TF-Keras Step 1.ipynb”

You can now interact with the code. Notice you will have to change the folder location variables.

You can grab datasets from here:

Leave a Reply

Your email address will not be published. Required fields are marked *