How To Install python3-keras on Ubuntu 20.04

In this tutorial we learn how to install python3-keras on Ubuntu 20.04. python3-keras is deep learning framework running on Theano or TensorFlow

Introduction

In this tutorial we learn how to install python3-keras on Ubuntu 20.04.

What is python3-keras

python3-keras is:

Keras is a Python library for machine learning based on deep (multi- layered) artificial neural networks (DNN), which follows a minimalistic and modular design with a focus on fast experimentation.

Features of DNNs like neural layers, cost functions, optimizers, initialization schemes, activation functions and regularization schemes are available in Keras a standalone modules which can be plugged together as wanted to create sequence models or more complex architectures. Keras supports convolutions neural networks (CNN, used for image recognition resp. classification) and recurrent neural networks (RNN, suitable for sequence analysis like in natural language processing).

It runs as an abstraction layer on the top of Theano (math expression compiler) by default, which makes it possible to accelerate the computations by using (GP)GPU devices. Alternatively, Keras could run on Google’s TensorFlow (not yet available in Debian).

There are three methods to install python3-keras on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-keras Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python3-keras using apt-get by running the following command:

sudo apt-get -y install python3-keras

Install python3-keras Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python3-keras using apt by running the following command:

sudo apt -y install python3-keras

Install python3-keras Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python3-keras using aptitude by running the following command:

sudo aptitude -y install python3-keras

How To Uninstall python3-keras on Ubuntu 20.04

To uninstall only the python3-keras package we can use the following command:

sudo apt-get remove python3-keras

Uninstall python3-keras And Its Dependencies

To uninstall python3-keras and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove python3-keras

Remove python3-keras Configurations and Data

To remove python3-keras configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge python3-keras

Remove python3-keras configuration, data, and all of its dependencies

We can use the following command to remove python3-keras configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3-keras

References

Summary

In this tutorial we learn how to install python3-keras package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.