Setup TensorFlow, Keras, Theano, Pytorch/torchvision on the CentOS VM

We need to use Keras with TensorFlow as backend for some deep learning projects in the Spark platform we practice data science. The platform we have been using is a CentOS VM running on software based hypervisor called VirtualBox.

Additionally, for future deep learning projects that may use the dataset with Apache Spark, we need to install Theano, Pytorch and Torchvision.

We already have Python 3.6 under virtual environment on Anaconda. Here are the steps:

Enter virtual environment spark

conda activate spark

Upgrade pip

 pip install pip --upgrade

#Collecting pip
#  Downloading pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
#     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.5 MB 2.5 MB/s
#Installing collected packages: pip
#  Attempting uninstall: pip
#    Found existing installation: pip 20.0.2
#    Uninstalling pip-20.0.2:
#      Successfully uninstalled pip-20.0.2
#Successfully installed pip-20.1.1

Install TensorFlow

conda install -c conda-forge tensorflow

#Collecting package metadata (current_repodata.json): done
#Solving environment: done
#
## Package Plan ##
#.....
#  environment location: /opt/hadoop/anaconda3/envs/spark

#  added / updated specs:
#    - tensorflow
#....
#Preparing transaction: done
#Verifying transaction: done
#Executing transaction: done

Verify TensorFlow installed successfully

Install Keras

Verify Keras is installed successfully

Install Theano

Install Pytorch

Install Torchvision

Verify all installation

Last updated

Was this helpful?