/deep_learning

Introduction to Deep Learning using Python and TensorFlow

Primary LanguageJupyter Notebook

Deep Learning

Supplemental files for the Deep Learning workshop, presented by the IDEA Student Center of UC San Diego.

Requirements

We will be using the Keras package to write our Deep Learning models, with TensorFlow as the backend:

  • python 3.5
  • numpy
  • matplotlib
  • keras >= 2.0.0
  • tensorflow >= 1.0.0
  • jupyter

NOTE: Python 2.7 should work on macOS and Linux, but only Python 3.5 is supported for TensorFlow on Windows.

Installation

If you previously installed Python using Anaconda (https://www.anaconda.com/download/), you can install the required packages using the following commands:

macOS

  1. open Terminal.app
  2. run the following commands in the terminal (type each line and hit enter):
    1. create a new Anaconda environment: conda create -n deeplearning python=3.6 numpy scipy matplotlib jupyter pandas scikit-learn pip
    2. activate the environment: source activate deeplearning
    3. install TensorFlow and Keras: pip install --upgrade tensorflow keras

Windows

  1. open the Anaconda Command Prompt
  2. run the following commands in the terminal (type each line and hit enter):
    1. create a new Anaconda environment: conda create -n deeplearning python=3.6 numpy scipy matplotlib jupyter pandas scikit-learn pip
    2. activate the environment: activate deeplearning
    3. install TensorFlow and Keras: pip install --upgrade tensorflow keras

Linux

  1. open a terminal program
  2. run the following commands in the terminal (type each line and hit enter):
    1. create a new Anaconda environment: conda create -n deeplearning python=3.6 numpy scipy matplotlib jupyter pandas scikit-learn pip
    2. activate the environment: source activate deeplearning
    3. install TensorFlow and Keras: pip install --upgrade tensorflow keras

Testing the installation

To test the installation (for macOS, Windows or Linux), run the following commands in the same terminal from above:

  • start python and load TensorFlow: python -c "import tensorflow; print(tensorflow.__version__)"
  • start python and load Keras: python -c "import keras; print(keras.__version__)"

You should see output similar to the following:

> python -c "import tensorflow; print(tensorflow.__version__)"
1.4.0

NOTE: Make sure you have the Anaconda environment activated before running the above test command. If you don't, the command will fail as it will not "know" where to look for the TensorFlow install.

Common issues

  • If TensorFlow fails to install, still try to install Keras (Keras defaults to TensorFlow for the backend, but can switch to Theano instead).
  • On Windows, TensorFlow is only compatible with Python 3.5+.
  • If you don't already have Python installed, we recommend installing it using the Anaconda distribution (https://www.anaconda.com/download/).
  • If you are already familiar with Python and installing packages with pip, you can skip installing Python using Anaconda and instead install the requirements using pip (e.g. pip install numpy matplotlib jupyter tensorflow keras).

Non-Anaconda installation

If you did not previously install Python using Anaconda, then you can follow the installation instructions listed in the official documentation for:

Demos

Online demos:

Articles:

Other TensorFlow and Keras tutorials