Setting up Tensorflow with Keras

Following up the deep learning workshop presented in SIS (slides), this note introduces how to setup TensorFlow and Keras in your own computer without affecting your existing installations of Python.

Setup

  1. Follow the instructions on the Anaconda download site to download and install Anaconda.
  2. Create a sperated python environment by issuing the following command:

    1
    conda create -n tensorflow python=3.5
  3. To activate this environment:

    1
    activate tensorflow
  4. You need to activate this environment everytime you want to play with TensorFlow+Keras

  5. Install TensorFlow by invoking:

    1
    pip install tensorflow
  6. Install Keras by invoking:

    1
    pip install keras
  7. If you encounter scipy installation erros here (look for red words), you can invoke the following command and install keras again.

    1
    conda install -c anaconda scipy
  8. Now you can call your python script:

    1
    python xxx.py
  9. Or you can play with a python notebook:

    1
    jupyter notebook

Other resources: