Table of contents:

  1. TensorFlow
  2. Available TensorFlow 2 Packages
  3. System Requirements
  4. Installing pip on CentOS for python3
  5. Installation of TensorFlow on Linux

TensorFlow

TensorFlow is an open-source machine learning platform used for machine learning and deep learning applications. Google team developed TensorFlow to develop and research fascinating ideas or artificial intelligence. TensorFlow is created using Python programming language, making it’s easy understand framework.

Below are the steps to install the TensorFlow 2.0 package. Please note that the latest TensorFlow version comes with both CPU and GPU flavours bundled together. GPU is used by default. Expect the warning about libnvinfer package not being found if you are not on a GPU supported machine.

Available TensorFlow 2 Packages

  • TensorFlow - latest stable release with GPU and CPU support
  • tf-nightly - preview build (unstable)

System Requirements

  • Python 3.5–3.7
  • pip 19.0 or later (requires manylinux2010 support)
  • Ubuntu 16.04 or later (64-bit)
  • macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)

TensorFlow is tested and supported on the following 64-bit systems:

  • Python 3.5–3.7
  • Ubuntu 16.04 or later
  • Windows 7 or later
  • macOS 10.12.6 (Sierra) or later (no GPU support)
  • Raspbian 9.0 or later

Installing pip on CentOS for python3

Pip is available in some CentOS versions but not in CentOS 7. To install pip on CentOS, enable EPEL repository with the commnad below:

sudo yum install epel-release -y

After enabling the EPEL repository, install the pip package with the command below:

sudo yum install python3-pip -y

Verify the pip version with the command below. If the version is 19 or higher, as stated above, skip step 4, otherwise, proceed:

pip3 –-version

Upgrade to the latest version using this command:

pip3 install --upgrade pip

Installation of TensorFlow on Linux

Install TensorFlow using the following commands:

pip3 install --user --upgrade tensorflow

Run the code below to verify TensorFlow installation:

python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([10, 10])))"

Reference:

  1. TensorFlow
  2. Python official website
  3. CentOS distro official website