Python and TensorFlow Installation

<< Click to Display Table of Contents >>

Navigation:  Installation of PAI Infrastructure > MacOS >

Python and TensorFlow Installation

Although MacOS provides Python libraries by default we recommend installing the newest available Python version 3.8 from the website https://www.python.org/downloads/mac-osx/

1.Install TensorFlow using the Terminal command:

python3 -m pip3 install --upgrade tensorflow==2.10.0

2.Check that tensorflow appears in the list of installed packages:

python3 -m pip list

3.Test TensorFlow using the command:

python3 -c "import tensorflow as tf;print(\"Num GPUs Available: \", len(tf.config.experimental.list_physical_devices('GPU')))"

This test returns the number of compatible GPUs available for PAI (zero is an acceptable result if you do not have a compatible NVIDIA GPU).

4.Install scikit-learn by entering in Terminal:

 python3 -m pip3 install --upgrade scikit-learn

5.Test scikit-learn by entering in Terminal:

 

 python3 -c "import sklearn; print(sklearn.__version__)"

 

6.Install PyTorch by entering in Terminal:

 

 python3 -m pip3 install --upgrade torch