Skip to content

cgpadwick/keras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get Up And Running With Keras Very Quickly

This repo was written to enable users to get up and running with Keras very quickly. You may have heard of Francios Challot's book "Deep Learning With Python" (https://www.manning.com/books/deep-learning-with-python). The book teaches you the ins and out of Keras by using jupyter notebooks.

Installation of Keras and Tensorflow can be pretty tricky. If you want to run on the GPU, you have to make sure that the version of CUDA that you install is compatible with Tensorflow (https://www.tensorflow.org/). The instructions in the book are out of date and do not work. If you are not a grizzled deep learning veteran, you could get pretty frustrated.

This guide is intended to get you up and running on either the CPU or the GPU as quickly as possible. If you don;t want to use docker, then follow the instructions in the sectioan called "Build A Virtual Enviroment". If you want to use docker, skip to the "Docker Quickstart" section.

Build A Virtual Environment

git clone [email protected]:cgpadwick/keras.git
cd keras/venv

# For a CPU build of tensorflow use:
make GPU=0

# If you watn GPU support (requires separate CUDA setup and install) use this:
make GPU=1

Now you can type source venv/keras_venv/bin/activate and you should have a fully functional keras/tensorflow python virtual environment.

Docker Quickstart

Clone this repo, setup your host (Ubuntu 16.04) with docker. If your host machine has a cuda enabled GPU, set GPU=1.

git clone [email protected]:cgpadwick/keras.git
cd keras/docker
make setup_host GPU=0

Clone the notebook code from the Deep Learning With Python repo.

cd ~
mkdir ~/data
cd data
git clone https://github.com/fchollet/deep-learning-with-python-notebooks

Start up a jupyter notebook inside the docker container. The notebook code will be mounted in the container under /home/ubuntu/data.

For a GPU enabled docker:

sudo nvidia-docker run -it -p 8888:8888 -v ~/data:/home/ubuntu/data cgpadwick/keras-containers:keras-ubuntu-16.04-tensorflow-gpu-1.8.0 /bin/bash -c "jupyter notebook --ip 0.0.0.0"

For a CPU-only docker:

sudo docker run -it -p 8888:8888 -v ~/data:/home/ubuntu/data cgpadwick/keras-containers:keras-ubuntu-16.04-tensorflow-1.8.0 /bin/bash -c "jupyter notebook --ip 0.0.0.0"

Copy and paste the token printed on the screen (something like http://0.0.0.0:8888/?token=gobbledegook) into a browser and hopefully you will see something like this:

Alt text

Use Ctrl-C to stop the notebook server and exit the docker container.

About

keras notebook repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages