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 start, login
import tensorflow_model_analysis as tfma

login()

experiment = start(project_name="comet-example-tfma-doc")

# Your TFMA code:

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

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

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

Summary¶

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¶

Dec. 17, 2024