1

Part of my pipeline:

    training_op = gcc_aip.AutoMLTabularTrainingJobRunOp(
        project=project,
        display_name=display_name,
        optimization_prediction_type="classification",
        budget_milli_node_hours=1000,
        column_transformations=[ ... ],
        dataset=dataset_create_op.outputs["dataset"],
        target_column="Class",
    )
    model_to_evaluate= training_op.outputs["model"]

    model_id=model_to_evaluate.name

This works except model_id is set to 'model'. I want the underlying model id ie the bit at the end of a model's resource name:

model_resource_name= f'projects/{PROJECT}/locations/{LOCATION}/models/{model_id}'
schoon
  • 2,858
  • 3
  • 46
  • 78

1 Answers1

0

What you're looking for is available in the metadata of the model artifact, with key name resourceName. Try model_to_evaluate.metadata['resourceName'].

You can also parse model_to_evalue.uri to get the model id. The URI is in format https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT}/locations/{LOCATION}/models/{model_id}

chesu
  • 56
  • 1