Hi, currently I'm working on vertex ai pipelines. I'm confused on how to update my model version on model registry.
Versions:
kfp 2.0.0rc1
kfp-pipeline-spec 0.2.2
kfp-server-api 2.0.0rc1
google_cloud_pipeline_components 2.0.0b
Here's the code snippet:
models = aiplatform.Model.list(filter=(“display_name={}“).format(MODEL_DISPLAY_NAME))
parent_model = models[0].resource_name
model_upload_op = ModelUploadOp(
project=PROJECT_ID,
display_name=MODEL_DISPLAY_NAME,
parent_model=,
unmanaged_container_model=unmanaged_model_importer.outputs[“artifact”],
).after(unmanaged_model_importer)
Error message:
InconsistentTypeException: Incompatible argument passed to the input 'parent_model' of component 'model-upload':
Argument type 'STRING' is incompatible with the input type 'google.VertexModel@0.0.1'
Is there any way to resolve this?
Thank you.
I also tried another method as below. No error, but it still uploaded to the model registry as a new model, not a new version.
models = aiplatform.Model.list(filter=(“display_name={}“).format(MODEL_DISPLAY_NAME))
model_id = models[0].resource_name
model_registry_importer = importer_node.importer(
artifact_uri=f'https://us-central1-aiplatform.googleapis.com/v1/{model_id}',
artifact_class=artifact_types.VertexModel,
metadata={"model_resource_name": model_id},
).after(unmanaged_model_importer)
model_upload_op = ModelUploadOp(
project=PROJECT_ID,
display_name=MODEL_DISPLAY_NAME,
parent_model=model_registry_importer.outputs["artifact"],
unmanaged_container_model=unmanaged_model_importer.outputs["artifact"],
).after(model_registry_importer)
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |