Registered models with AML SDK v2 doesn't appear in pipeline

Matias 5 Reputation points
2023-03-07T10:17:10.4466667+00:00

I have successfully been able to register a model in AML workspace, using SDK v2, however, when I navigate to AML workspace UI and the given pipeline, the registered model don't appear:

User's image

I have registered the models using both this method:

cloud_model = Model(
    path=model_path,
    name="cloud-path-example",
    type=AssetTypes.CUSTOM_MODEL,
    description="Model created from cloud path.",
)
ml_client.models.create_or_update(cloud_model)

and this method:

mlflow.spacy.save_model(nlp, output_folder)
model_path = os.path.abspath(output_folder)
mlflow.register_model(f"file://{model_path}", "model-test")

Both methods successfully registers the model but the "connection" between the registered model and the pipeline run is missing. What could the reason for this be? My impression is that this "connection" should appear automatically?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,552 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Matias 5 Reputation points
    2023-03-07T14:17:00.1933333+00:00

    Ok, so answering my own question, model path has to be on the form azureml://jobs/<run-id>/outputs/artifacts/paths/model/ or similar in order for the connection to happen.

    https://github.com/Azure/azureml-examples/blob/main/sdk/python/assets/model/model.ipynb

    1 person found this answer helpful.