Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Impossible to create vertex AI model version with ModelUploadOp

Hi, currently I'm working on vertex ai pipelines.

I use 

```

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"],
)

```

`model_id` is the model ID of the existing model managed in model registry.

I got the next error message.

```ValueError: Failed to create the resource. Error: {'code': 400, 'message': 'List of found errors:\t1.Field: parent_model; Message: Location ID is not provided.\t', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'parent_model', 'description': 'Location ID is not provided.'}]}]}```

I would like to know how to get the correct value of parent_model.
Thank you.

 

4 REPLIES 4

Hi, were you able to fix the issue?

Unfortunately, I haven't solved it yet.
Do you know the solution?

btw try using "resourceName" instead of model_resource_name

"resourceName" worked for me. Thanks !!