Skip to content

Integrate with TensorFlow Model Analysis

Comet integrates with TensorFlow Model Analysis.

If you're already using TensorFlow and TensorFlow Model Analysis (TFMA), then Comet works with no further customization. Just add these lines of code to your training script:

import os
os.environ["COMET_AUTO_LOG_TFMA"] = "1"

from comet_ml import Experiment
import tensorflow_model_analysis as tfma

experiment = Experiment()

# Your TFMA code:

results = tfma.load_eval_result("/path/to/results")

tfma.view.render_slicing_metrics(results, 'a_column')

That's it for logging the results!

To see them in the Comet UI, you can use the custom TFMA Viewer Panel at either the Project View, or the Experiment View.

TensorFlow Model Analysis


To use TFMA with Comet, perform the followig steps:

  1. Set the Comet configuration variable "COMET_AUTO_LOG_TFMA" to "1".
  2. Create a Comet Experiment().
  3. Render your TFMA results as normal.
  4. See results in your experiment asset, and the custom "TFMA Viewer" panel.

Try it out!

Here's an example for using Comet with TensorFlow Model Analysis.

Open In Colab

Learn more

May. 17, 2024