Chat Zalo Chat Messenger Phone Number Đăng nhập
Install TensorFlow with pip

Install TensorFlow with pip

This guide is for the latest stable version of TensorFlow. For the preview (nightly), use the pip package named tf-nightly. See these tables for requirements for previous versions of TensorFlow. For CPU-only compilation, use the pip package named tensorflow-cpu.

Here are the quick versions of the installation commands. Scroll down for step-by-step instructions.

Hardware requirements

Note: TensorFlow binaries use AVX statements that may not run on older CPUs.

The following devices enabled for

GPU:

  • NVIDIA® GPU card with CUDA® 3.5, 5.0, 6.0, 7.0, 7.5, 8.0 and higher architectures. See the list of CUDA-enabled® GPU cards.
  • For GPUs with unsupported CUDA® architectures, or to avoid JIT compilation from PTX, or to use different versions of NVIDIA libraries, see the® Linux from source build guide.
  • The packages do not contain PTX code except for the latest CUDA® architecture supported; therefore, TensorFlow is not loaded on older GPUs when CUDA_FORCE_PTX_JIT=1 is set. (See Application compatibility for more information.)

Note: The error message “Status: Device kernel image is invalid” indicates that the TensorFlow package does not contain PTX for your architecture. You can enable compute capabilities by building TensorFlow from the source.

System Requirements

Ubuntu 16.04 or higher (64-bit) macOS 10.12.6 (Sierra) or higher (64-bit) (without GPU support) Windows Native – Windows 7 or higher (64-bit) (no GPU support after TF 2.10) Windows

  • WSL2 – Windows 10 19044 or higher (64-bit)
  • Note:

  • GPU
  • support is available for Ubuntu and Windows with CUDA-enabled cards

  • .

®

Software requirements

Python 3.8-3.11 pip version 19.0 or higher for

  • Linux (requires manylinux2014 support)
  • and Windows. pip version 20.3 or higher for macOS.

  • Windows Native requires Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, and 2019
  • The following NVIDIA software is only required for GPU support. NVIDIA GPU drivers

version 450.80.02 or higher.

®

  • ®
  • CUDA® Toolkit 11.8.
  • cuDNN SDK 8.6.0.
  • (Optional) TensorRT to improve latency and throughput for inference.

Step-by-step instructions

Package location

Some installation mechanisms require the TensorFlow Python package URL. The value you specify depends on your version of Python.

GPU VersionURL support https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-2.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 3.8 CPU support for Python 3.8 CPUs only https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3.9 GPUs https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-2.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3.9 CPU only https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3.10 GPU support https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-2.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python CPU only 3.10 https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl macOS (CPU only)Python 3.8 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.12.0-cp38-cp38-macosx_10_15_x86_64.whl Python 3.9 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.12.0-cp39-cp39-macosx_10_15_x86_64.whl Python 3.10 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.12.0-cp310-cp310-macosx_10_15_x86_64.whl WindowsPython 3.8 CPU only https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.12.0-cp38-cp38-win_amd64.whl Python 3.9 CPU only https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.12.0-cp39-cp39-win_amd64.whl Python 3.10 CPU only https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.12.0-cp310-cp310-win_amd64.whl

Contact US