Skip to main content

Model Reporting

The example demonstrates logging a model using the OutputModel class.

The example does the following:

  • Creates a task named Model reporting example in the examples project.
  • Uses an OutputModel object to register a previously trained model and log its label enumeration.


An OutputModel object is instantiated for the task.

from clearml import Task, OutputModel

# Connecting ClearML with the current process,
task = Task.init(project_name="examples", task_name="Model logging example")

# Create output model and connect it to the task
output_model = OutputModel(task=task)

Label Enumeration

Set the model’s label enumeration using the OutputModel.update_labels method.

labels = {"background": 0, "cat": 1, "dog": 2}

Registering Models

Register a previously trained model using the OutputModel.update_weights method. The example code uses a model stored in S3.

# Manually log a model file, which will have the labels connected above


The model appears in the task’s ARTIFACTS tab.

Task artifacts

Clicking on the model name takes you to the model’s page, where you can view the model’s details and access the model.

The model’s LABELS tab displays its label enumeration.

Model Labels tab

Additional Example

See PyTorch Model Updating for a more robust example, which trains a model, and then logs it with OutputModel.