@@ -63,44 +63,6 @@ def create_model(
6363 print ("Training operation name: {}" .format (response .operation .name ))
6464 print ("Training started..." )
6565
66- # synchronous check of operation status.
67- model = response .result ()
68-
69- # Retrieve deployment state.
70- if model .deployment_state == enums .Model .DeploymentState .DEPLOYED :
71- deployment_state = "deployed"
72- else :
73- deployment_state = "undeployed"
74- # Display the model information.
75- print ("Model name: {}" .format (model .name ))
76- print ("Model id: {}" .format (model .name .split ("/" )[- 1 ]))
77- print ("Model display name: {}" .format (model .display_name ))
78- print ("Image classification model metadata:" )
79- print (
80- "Training budget: {}" .format (
81- model .image_classification_model_metadata .train_budget
82- )
83- )
84- print (
85- "Training cost: {}" .format (
86- model .image_classification_model_metadata .train_cost
87- )
88- )
89- print (
90- "Stop reason: {}" .format (
91- model .image_classification_model_metadata .stop_reason
92- )
93- )
94- print (
95- "Base model id: {}" .format (
96- model .image_classification_model_metadata .base_model_id
97- )
98- )
99- print ("Model create time:" )
100- print ("\t seconds: {}" .format (model .create_time .seconds ))
101- print ("\t nanos: {}" .format (model .create_time .nanos ))
102- print ("Model deployment state: {}" .format (deployment_state ))
103-
10466
10567# [END automl_vision_create_model]
10668
@@ -116,7 +78,9 @@ def get_operation_status(operation_full_id):
11678 client = automl .AutoMlClient ()
11779
11880 # Get the latest state of a long-running operation.
119- response = client ._operations_client .get_operation (operation_full_id )
81+ response = client .transport ._operations_client .get_operation (
82+ operation_full_id
83+ )
12084
12185 print ("Operation status: {}" .format (response ))
12286
0 commit comments