Register model from pipeline (CLI v2)

Viewed 205

I have a pipeline where I do training for a model and at the end I'd like to register that model but I can't find any information on this.

Here's how my pipeline looks now:

type: pipeline_job

compute:
  target: azureml:gpu-cluster

inputs:
  input_images:
    data:
      datastore: azureml:dualcam
      path: /image-20210701*

jobs:
  training:
    type: component_job
    component: file:./components/training.yml
    inputs:
      input_images: inputs.input_images
1 Answers

You can upload it to the run using upload_file and then register the model.

Uploading the model into the run history record before trying to register the model:

run.upload_file("outputs/my_model.pickle", "outputs/my_model.pickle")
print(run.get_file_names())
print(os.getcwd())
model = run.register_model(model_name='simtemp', model_path="outputs/{}".format(model_file_name))

Please follow the document for run.

Related