【发布时间】:2020-03-23 23:42:00
【问题描述】:
我正在尝试使用 automl 的标准示例。我希望 create_model 能够启动一个长时间运行的操作,一旦完成就会更新操作响应,然后访问元数据(以获取新训练模型的 model_id)。但是脚本在metadata = response.metadata() 和"TypeError: 'OperationMetadata' object is not callable" 上立即失败。
如果有任何区别,我将在 Airflow/google composer 中的 PythonOperator 中运行此代码。我可以在 AutoML UI 中看到模型开始正确训练。
我的代码是这样的,但是it's basically the example usage that's in the docs.:
from google.cloud import automl
client = automl.AutoMlClient()
...
response = client.create_model(project_location, my_model)
def callback(operation_future):
# Handle result.
result = operation_future.result()
response.add_done_callback(callback)
metadata = response.metadata()
我正在使用 google-cloud-automl==0.9.0
【问题讨论】:
-
我建议在github.com/googleapis/google-cloud-python/issues 将其作为一个问题打开。
标签: google-cloud-composer google-cloud-automl google-cloud-python