Appendix A. Installing Keras and its dependencies on Ubuntu
The process of setting up a deep-learning workstation is fairly involved and consists of the following steps, which this appendix will cover in detail:
- Install the Python scientific suite—Numpy and SciPy—and make sure you have a Basic Linear Algebra Subprogram (BLAS) library installed so your models run fast on CPU.
- Install two extras packages that come in handy when using Keras: HDF5 (for saving large neural-network files) and Graphviz (for visualizing neural--network architectures).
- Make sure your GPU can run deep-learning code, by installing CUDA drivers and cuDNN.
- Install a backend for Keras: TensorFlow, CNTK, or Theano.
- Install Keras.
It may seem like a daunting process. In fact, the only difficult part is setting up GPU support—otherwise, the entire process can be done with a few commands and takes only a couple of minutes.
We’ll assume you have a fresh installation of Ubuntu, with an NVIDIA GPU available. Before you start, make sure you have pip installed and that your package manager is up to date:
$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install python-pip python-dev