Appendix A. Installing Keras and its dependencies on Ubuntu
This appendix provides a step-by-step guide to configuring a deep-learning workstation with GPU support on Ubuntu. You should also consult https://tensorflow.rstudio.com/tools/local_gpu, which is an up-to-date guide to local GPU configuration for all platforms.
The process of setting up a deep-learning workstation is fairly involved. It consists of the following steps, which we’ll cover in detail:
- Installing some system-level prerequisites, including a Basic Linear Algebra Subprogram (BLAS) library so your models run fast on CPU
- Making sure your GPU can run deep-learning code, by installing CUDA drivers and cuDNN
- Installing Keras and the TensorFlow backend
It may seem like a daunting procedure. 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.
Keras is implemented in Python and depends on the Python package manager pip for its installation. To begin, make sure you have pip installed and that your package manager is up to date: