Registration is open for TensorFlow Dev Summit 2020 Learn more

TensorFlow Model Analysis

TensorFlow Model Analysis (TFMA) is a library for evaluating TensorFlow models. It allows users to evaluate their models on large amounts of data in a distributed manner, using the same metrics defined in their trainer. These metrics can be computed over different slices of data and visualized in Jupyter notebooks.

TFMA Slicing Metrics Browser


The recommended way to install TFMA is using the PyPI package:

pip install tensorflow-model-analysis

Currently, TFMA requires that TensorFlow is installed but does not have an explicit dependency on the TensorFlow PyPI package. See the TensorFlow install guides for instructions.

To enable TFMA visualization in Jupyter Notebook:

  jupyter nbextension enable --py widgetsnbextension
  jupyter nbextension install --py --symlink tensorflow_model_analysis
  jupyter nbextension enable --py tensorflow_model_analysis


Apache Beam is required to run distributed analysis. By default, Apache Beam runs in local mode but can also run in distributed mode using Google Cloud Dataflow. TFMA is designed to be extensible for other Apache Beam runners.

Getting Started

For instructions on using TFMA, see the get started guide.

Compatible Versions

The following table is the TFMA package versions that are compatible with each other. This is determined by our testing framework, but other untested combinations may also work.

tensorflow-model-analysis tensorflow apache-beam[gcp]
GitHub master nightly (1.x/2.x) 2.16.0
0.15.4 1.15 / 2.0 2.16.0
0.15.3 1.15 / 2.0 2.16.0
0.15.2 1.15 / 2.0 2.16.0
0.15.1 1.15 / 2.0 2.16.0
0.15.0 1.15 2.16.0
0.14.0 1.14 2.14.0
0.13.1 1.13 2.11.0
0.13.0 1.13 2.11.0
0.12.1 1.12 2.10.0
0.12.0 1.12 2.10.0
0.11.0 1.11 2.8.0
0.9.2 1.9 2.6.0
0.9.1 1.10 2.6.0
0.9.0 1.9 2.5.0
0.6.0 1.6 2.4.0


Please direct any questions about working with TFMA to Stack Overflow using the tensorflow-model-analysis tag.