Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty export model response - 'google.cloud.aiplatform_v1beta1.types.model_service.ExportModelResponse' #197

Closed
zdhernandez opened this issue Jan 29, 2021 · 7 comments

Comments

@zdhernandez
Copy link

zdhernandez commented Jan 29, 2021

@dizcology @morgandu While trying to export an edge model to a cloud bucket I noticed that the export_model_sample, as well as the example shown in the AiPlatform documentation, prints an empty response when the last line is executed:

print("export_model_response:", export_model_response)

The snippets section of this Github repository, doe not have a separate example to get the export status. Because of this, I was expecting that the last line: print("export_model_response:", export_model_response) would print the status of the operation like the example using the REST &CMD Line that looks like:

{
  "name": "projects/PROJECT/locations/LOCATION/models/MODEL_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1beta1.ExportModelOperationMetadata",
    "genericMetadata": {
      "createTime": "2020-10-12T20:53:40.130785Z",
      "updateTime": "2020-10-12T20:53:40.793983Z"
    },
    "outputInfo": {
      **"artifactOutputUri": "gs://OUTPUT_BUCKET/model-MODEL_ID/EXPORT_FORMAT/YYYY-MM-DDThh:mm:ss.sssZ"**
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1beta1.ExportModelResponse"
  }
}

Using Python I need to get the "artifactOutputUri" to know the full path where the exported model was stored at.

@zdhernandez zdhernandez changed the title GCP AiPlatform Python - Empty Export Model Response empty export model response Jan 29, 2021
@zdhernandez zdhernandez changed the title empty export model response empty export model response - <class 'google.cloud.aiplatform_v1beta1.types.model_service.ExportModelResponse'> Feb 1, 2021
@zdhernandez zdhernandez changed the title empty export model response - <class 'google.cloud.aiplatform_v1beta1.types.model_service.ExportModelResponse'> empty export model response - 'google.cloud.aiplatform_v1beta1.types.model_service.ExportModelResponse' Feb 1, 2021
@dizcology
Copy link
Contributor

dizcology commented Feb 1, 2021

@zdhernandez The status such as "done": true belongs to the operation and not the export_model_response, which is indeed empty (source).

Note that the response object in the sample code refers to the operation, and not the actual (empty) response. The API for interacting with the operation can be found here: https://googleapis.dev/python/google-api-core/latest/operation.html

In particular, you can retrieve the operation's metadata through the operation's metadata property.

@zdhernandez
Copy link
Author

zdhernandez commented Feb 1, 2021

@dizcology But shouldn't it print at least something and not empty? Because the other samples like the one to "create a dataset image" follow the same steps and it does print at least something. I would image that from a convention or to keep thing uniform that this print(export_model_response) would print out at least something that I can see in the console. For instance if I run the create_dataset_image_sample the operation waits and the print(create_dataset_response) prints this output to the console:

> Long running operation: projects/34925123123123/locations/us-central1/datasets/385355123123123123/operations/8009042123123123123
create_dataset_response: name: "projects/3492123123123/locations/us-central1/datasets/38535507123123123123"
display_name: "TEST_DATASET"
metadata_schema_uri: "gs://google-cloud-aiplatform/schema/dataset/metadata/image_1.0.0.yaml"
labels {
  key: "aiplatform.googleapis.com/dataset_metadata_schema"
  value: "IMAGE"
}
metadata {
  struct_value {
    fields {
      key: "dataItemSchemaUri"
      value {
        string_value: "gs://google-cloud-aiplatform/schema/dataset/dataitem/image_1.0.0.yaml"
      }
    }
  }
}

done

And the other code samples do the same. So unless I'm confused, what I am saying is that I am expecting print(export_model_response) to output the JSON from the response to the console. That way I can grab the "artifactOutputUri" to know where the exported model was stored at. Do you agree ? or am I missing something? Each sample code snippet so far follows pretty much the same convention.

@dizcology
Copy link
Contributor

@zdhernandez I quite agree that the samples should print also the output_info. Let me look into that.

@zdhernandez
Copy link
Author

@dizcology Thank you! 👍

@dizcology
Copy link
Contributor

@zdhernandez I updated the samples in this PR: #204

@zdhernandez
Copy link
Author

@dizcology awesome! thanks

@dizcology
Copy link
Contributor

The PR with updated samples was merged. Closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants