Install TensorFlow Ranking
Stay organized with collections
Save and categorize content based on your preferences.
There are several ways to set up your environment to use the TensorFlow Ranking library.
- The easiest way to learn and use TensorFlow Ranking is run any of the tutorials Google Colab. Select the link at the top of the Quickstart tutorial).
- To use the Ranking library on a local machine, install the
tensorflow_rankingpip package. - If you have a unique machine configuration, you can build the package from source, using the Build from source instructions.
Install TensorFlow Ranking using pip
Install using pip.
pipinstall--upgradetensorflow_rankingBuild from source
You can also install from source, which requires the Bazel build system.
Install Bazel, Git and Pip.
sudoapt-getupdatesudoapt-getinstallbazelgitpython3-pippython3-venvClone the TensorFlow Ranking repository.
gitclonehttps://github.com/tensorflow/ranking.git
Build TensorFlow Ranking wheel file and store them in a
/tmp/ranking_pipfolder.cdranking# folder cloned in Step 2.bazelbuild//tensorflow_ranking/tools/pip_package:build_pip_packagebazel-bin/tensorflow_ranking/tools/pip_package/build_pip_package\ /tmp/ranking_pipActivate a
venvenvironment.python3-mvenv--system-site-packagesvenvsourcevenv/bin/activateInstall the wheel package in your
venvenvironment.pip install /tmp/ranking_pip/tensorflow_ranking*.whlOptionally, run all TensorFlow Ranking tests.
bazel test //tensorflow_ranking/...
For more information about installing Python, pip, TensorFlow, and working with Python virtual environments, see Install TensorFlow with pip.