Rate This Document
Findability
Accuracy
Completeness
Readability

Porting TensorFlow 2.4.1

Procedure

  1. Create a TensorFlow build environment.
    conda create -n bazel_build bazel=3.7 python=3.7.12  -c conda-forge
  2. Activate the build environment.
    conda activate bazel_build
  3. Install the build dependencies.
    conda install -c conda-forge keras-preprocessing=1.1.2 numpy=1.18.5
  4. Download the TensorFlow 2.4.1 source code.
    git clone https://github.com/tensorflow/tensorflow.git -b v2.4.1
  5. Go to the source code directory.
    cd tensoflow
  6. Configure the build environment.
    python configure.py

  7. Compile the source code.
    bazel build //tensorflow/tools/pip_package:build_pip_package

    Due to network problems, many resources cannot be automatically obtained during bazel build. You need to download the required resources and change the URLs in the build file to the local paths. For details, see Many Resources Fail to Be Automatically Obtained for Bazel Build When Porting TensorFlow 2.4.1.

  8. Build the local conda package of TensorFlow.
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /path/to/tensorflow

    The built TensorFlow installation package is stored in the /path/to/tensorflow directory.