This notebook explains how to install all the preriquistes and libraries that you will need to run the following tutorials. If you can execute all the following cells, you are good to go.
There are two major package managers in Python: pip and conda. For this tutorial we will be using conda which, besides being a package manager is also useful as a version manager. There are two main ways to install conda: Anaconda and Miniconda.
In order to install tensorflow we recommend following the official documentation. In particular, for the conda installation, they advise to use pip instead of conda as the only available Anaconda package for tensorflow is not actively mantained.
All the available tensorflow versions (for both Python 2 and 3 and with CPU and GPU support) can be found in this link. For this course we will be using: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl
The commands to setup the environment are the following
$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh
$ conda create --name keras python=3.5
$ source activate keras
(keras) $ conda install numpy scipy jupyter nb_conda
(keras) $ export tfBinaryURL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl
(keras) $ pip install $tfBinaryURL
(keras) $ conda install -c conda-forge keras
(keras) $ jupyter notebook
In the previous code, replace $tfBinaryURL
with the version of tensorflow to use.
Now you check if keras was succesfully installed.
In [1]:
import keras
print(keras.__version__)
These are some optional libraries to download in order to see some visualizations. They take a while, so if you don't have good Internet connection or no time you can skip them.
(keras) $ conda install -c conda-forge pydotplus
(keras) $ conda install graphviz
(keras) $ conda install scikit-learn
(keras) $ conda install seaborn
In [2]:
from keras.datasets import mnist
mnist.load_data();
Those are all the requirements you need. Now you are ready to go to tutorial number 1!