Below command line functions shows how to install Tensorflow on Centos 7. For your information, below guide is based on Tensorflow version 1.12.0.

STEP 1. Install Python, PIP and associated components

sudo yum -y install epel-release
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
STEP 2. Upgrade VirtualEnv by PIP
pip install --upgrade virtualenv
virtualenv --system-site-packages ~/venvs/tensorflow
source ~/venvs/tensorflow/bin/activate
pip install --upgrade numpy scipy wheel cryptography #optional
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.12.0rc0-cp35-cp35m-linux_x86_64.whl
If you face an error like below when you run the end of line above
tensorflow-1.12.0rc0-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.

You can do it as below as an alternative solution

python -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.12.0-cp27-none-linux_x86_64.whl


STEP 3. If you want gpu, support, but cuda and cudnn are required, see docs for more install instructions
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-1.12.0rc0-cp35-cp35m-linux_x86_64.whl

Reference: https://gist.github.com/87170360/0d445ae4100c2686067ee56901b42f9b

  • No labels