Python and TensorFlow Installation

<< Click to Display Table of Contents >>

Navigation:  Installation of PAI Infrastructure > Windows >

Python and TensorFlow Installation

The additional packages required for PAI on Windows should be installed from their respective websites.

Please follow these steps:

1.Install Microsoft Visual Studio 2015, 2017, 2019 Runtime (i.e VC_redist.x86.exe). https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

2.Check whether you have a compatible GPU. TensorFlow only supports NVIDIA GPUs in combination with NVIDIA’s CUDA Toolkit. Tables of compatible GPUs are available on https://developer.nvidia.com/cuda-gpus

3.If your GPU is compatible, install NVIDIA drivers, Toolkit and models for TensorFlow and PyTorch:

a.Drivers: https://www.nvidia.com/download/index.aspx?lang=en-us

b.CUDA Toolkit 11.2 (TensorFlow) 11.6 (PyTorch): https://developer.nvidia.com/cuda-toolkit-archive

c.cuDNN 8.1 for CUDA 11.2 (TensorFlow) and cuDNN 8.6 for CUDA 11.6: https://developer.nvidia.com/rdp/cudnn-download

4.Install Python 3.8 64-bit (select “Add Python to PATH”, enable pip option and long paths). https://www.python.org/downloads/windows/

5.Upgrade pip by entering in a command terminal:
pip3 install --upgrade pip

6.Install TensorFlow by entering in a command terminal:
pip3 install -U tensorflow==2.10.0

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

8.Test TensorFlow by entering in a command terminal:
python -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 CUDA-compatible NVIDIA GPU.

9.Install scikit-learn by entering in a command terminal:

  pip3 install -U scikit-learn

 

10.Test scikit-learn by entering in a command terminal:

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

 

11.Install PyTorch.

  For CPU:

   pip3 install -U torch

  For GPU:

   pip3 install -U torch --extra-index-url https://download.pytorch.org/whl/cu116

 

 

Note: GPU support for Windows (point 3. above) was tested for TensorFlow 2.104 and PyTorch 1.13