Model

A developer guide for creating and managing model directories.

Client

Create a model

model = client.create_model(
  name="<model_name>",
  ontology_id="<ontology_id>"
)

Get a model

model = client.get_model("<model_id>")
models = client.get_models(where=(Model.name == "<model_name>"))

Methods

Create a model run

model.create_model_run(name="<model_run_name>"

# optionally, you can supply details of the model run config
model.create_model_run(
  name="<model_run_with_config>",
  config={
    "learning_rate": 0.001,
    "batch_size": 32
  }
)

Delete a model

❗️

Deleting a model cannot be undone

This method deletes the model directory along with all its model runs. This action cannot be reverted without the assistance of Labelbox support.

model.delete()

Attributes

Get the basics

# name (str)
model.name

Get the model runs

# get the model runs (relationship to ModelRun objects)
model_runs = model.model_runs()

# inspect one model run
next(model_runs)

# inspect all model runs
for model_run in model_runs:
  print(model_run)