How to Install the Python Spyder and python libraries making use of them
How to Install the Python Spyder and python libraries making use of them
Keras is a tool for machine learning specialists who work with Python, mostly used due to
the convenience of mathematical calculations. Developers use Keras to create, configure, and
test machine learning and artificial intelligence systems, primarily neural networks.
CentOS 7 can be used on various physical and virtual devices, including laptops,
embedded systems, workstations, and servers. It also supports all the major cloud
computing platforms like Amazon Web Services (AWS), Microsoft Azure, and Google
Cloud Platform (GCP)
>>>
You should see the version of Python 3 installed on your system as well as a change in the command prompt
characters.
However, in some cases, you might want to have the most recent version of Python available, and that’s where
a source installation can come in handy for which we have a detailed article that covers installing Python 3 on
CentOS 7.
Install TensorFlow
TensorFlow is one of the backend engines that we need to install before Keras can be installed.
# mkdir test
# cd test
Use the following command to create a virtual environment with Python. It creates a virtual environment
named tf-virtual-env. Replace this with your chosen name:
# source tf-virtual-env/bin/activate
The prompt changes in the terminal, which means you activated it successfully:
(tf-virtual-env) # _
Type deactivate at the prompt and press Enter to exit the environment.
TensorFlow requires at least version 19.0 of Pip. Use the following command to ensure you have the latest
version:
# python
Then, type the following command. The first line will import the TensorFlow packages into the Python
interpreter session, while the second line will print the TensorFlow version:
import tensorflow as tf
print(tf.__version__)'
Install Keras
Thanks to a new update in TensorFlow 2.0+, if you installed TensorFlow as instructed, you don’t need to install
Keras anymore because it is installed with TensorFlow.
# python
At the prompt, run the following commands:
import keras
keras.__version__
For those using TensorFlow versions before 2.0, here are the instructions for installing Keras using Pip.
Collecting keras
Obtaining dependency information for keras from
https://files.pythonhosted.org/packages/2e/f3/19da7511b45e80216cbbd9467137b2d28919c58ba1ccb971435cb631e4
70/keras-2.13.1-py3-none-any.whl.metadata
Downloading keras-2.13.1-py3-none-any.whl.metadata (2.4 kB)
Downloading keras-2.13.1-py3-none-any.whl (1.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB
11.1 MB/s eta 0:00:00
Installing collected packages: keras
Successfully installed keras-2.13.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the
system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Step 2: Verify Installation of Keras
Verify the install of Keras by displaying the package information:
Name: keras
Version: 2.13.1
Summary: Deep learning for humans.
Home-page: https://keras.io/
Author: Keras team
Author-email: keras-users@googlegroups.com
License: Apache 2.0
Location: /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages
Requires:
Required-by: