Export data for model training

Export model data (ground truth, labels, data splits) to train a model in your desired computing environment.

Now that you have created a model that defines the data ontology for your machine learning task, and created a model run that configures the data splits, the next step is to train a machine learning model!

There are two ways to train a model:

  1. Train a model directly from the Labelbox UI using the model training integration (beta). See more in How to train a model in Labelbox.

  2. Export your data and data splits to train a model in your custom ML environment outside of Labelbox. Follow the instructions below to learn how to export your Model Run data.

Export Model Run data via the UI

  1. Navigate to the Model run from which you want to export data.
  2. Click N data rows, and then click Export.
  3. Instructions for exporting the data with Python SDK will appear in a pop-up window. You can use that sample script directly in your data preparation scripts for model training. Alternatively, you can download the exported data in JSON format by clicking Download export.

Export Model Run data via the SDK

Copy and paste this sample script directly in your data preparation scripts for model training.

import labelbox
LB_API_KEY = 'YOUR_API_KEY'
MODEL_RUN_ID = 'YOUR_MODEL_RUN_ID'
client = labelbox.Client(api_key = LB_API_KEY, enable_experimental=True)
model_run = client.get_model_run(MODEL_RUN_ID)
labels = model_run.export_labels(download=True)

Did this page help you?