简体   繁体   English

如何使用谷歌云 AutoML 创建数据集

[英]How to create a dataset with google cloud AutoML

Silly question, but I'm new to Python and Google Cloud.愚蠢的问题,但我是 Python 和 Google Cloud 的新手。 I'm trying to predict customer-lifetime-value with google cloud automl_v1beta1, the code is here我正在尝试使用 google cloud automl_v1beta1 预测客户生命周期价值,代码在这里

 from google.cloud.automl_v1beta1 import AutoMlClient, PredictionServiceClient from google.cloud_v1beta1 import automl client = AutoMlClient.from_service_account_file(keyfile_name) location_path = f"projects/{project_id}/locations/us-central1" dataset_display_name = automl_dataset # create dataset create_dataset_response = client.create_dataset( parent=location_path, dataset={'display_name': dataset_display_name, 'tables_dataset_metadata': {}})

and I received the following errors: \我收到以下错误:\

 Traceback (most recent call last): File "/home/tensorflow-lifetime-value/clv_automl/test1.py", line 220, in <module> main() File "/home/tensorflow-lifetime-value/clv_automl/test1.py", line 193, in main model_name = create_automl_model(client, File "/home/tensorflow-lifetime-value/clv_automl/test1.py", line 48, in create_automl_model create_dataset_response = client.create_dataset( File "/home/.local/lib/python3.9/site-packages/google/cloud/automl_v1/services/auto_ml/client.py", line 623, in create_dataset request.dataset = dataset File "/usr/local/lib/python3.9/dist-packages/proto/message.py", line 757, in __setattr__ pb_value = marshal.to_proto(pb_type, value) File "/usr/local/lib/python3.9/dist-packages/proto/marshal/marshal.py", line 211, in to_proto pb_value = rule.to_proto(value) File "/usr/local/lib/python3.9/dist-packages/proto/marshal/rules/message.py", line 36, in to_proto return self._descriptor(**value) ValueError: Protocol message Dataset has no "tables_dataset_metadata" field.

I got the same error using your code when I used google-cloud-automl<=0.1.2 .当我使用google-cloud-automl<=0.1.2时,我使用您的代码遇到了同样的错误。 Your error will be fixed if you use google-cloud-automl>=0.1.2 .如果您使用google-cloud-automl>=0.1.2 ,您的错误将得到修复。 But I suggest to always install the latest version by doing pip install --upgrade google-cloud-automl to maximize the latest updates from Google Cloud.但我建议始终通过执行pip install --upgrade google-cloud-automl来安装最新版本,以最大化来自 Google Cloud 的最新更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Google AutoML Vision Python API 来更新数据集 - How to use Google AutoML Vision Python API to update_dataset Docker 上的 Google Cloud AutoML 预测 - Google Cloud AutoML prediction on Docker 错误:谷歌云 AutoML 无法导入库 - Error: google cloud AutoML cannot import library 如何使用单独的数据集验证 Databricks 上的自动结果 - How to validate automl result on the Databricks with a separate dataset 如何使用 anaconda 为 python 安装 google.cloud automl_v1beta1? - How to install google.cloud automl_v1beta1 for python using anaconda? Google Vertex AI AutoML - 无法为 CSV 数据集指定架构 - Google Vertex AI AutoML - cannot specify schema for CSV Dataset Google Cloud Vision AutoML 和 TensorFlow Object 检测差异 - Google Cloud Vision AutoML and TensorFlow Object Detection Differences Databricks AutoML - 数据集上传 - Databricks AutoML - dataset upload 如何使用Google AutoML更改预测阈值? - How to change prediction threshold using Google AutoML? 使用Google Cloud AutoML模型预测Firebase功能存储在Google Cloud存储中的图像 - Use Google Cloud AutoML model predict an image which is stored in Google Cloud storage in Firebase function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM