【问题标题】:Required field is invalid error when trying to create new dataset in GCP AutoML object detection尝试在 GCP AutoML 对象检测中创建新数据集时,必填字段无效错误
【发布时间】:2020-01-28 01:11:45
【问题描述】:

我正在关注AutoML object detection 的快速入门。不幸的是,我遇到了一个我无法弄清楚的错误。在第一个 curl 命令

curl -X POST \
           -H "Authorization: Bearer $TOKEN" \
           -H "Content-Type: application/json" \
           "https://automl.googleapis.com/v1beta1/projects/$PROJECT_ID/locations/us-central1/datasets" -d '{
               "display_name": "dataset_name",
               "image_object_detection_dataset_metadata": {
               }
           }'

我收到此错误:

{
  "error": {
    "code": 400,
    "message": "List of found errors:\t1.Field: parent; Message: Required field is invalid\t",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "parent",
            "description": "Required field is invalid"
          }
        ]
      }
    ]
  }
}

这似乎是某种架构验证错误,所以也许他们更改了请求正文格式,但我不知道如何更改它。

【问题讨论】:

    标签: google-cloud-platform google-cloud-automl


    【解决方案1】:

    Doh,原来PROJECT_ID 变量实际上并没有设置。

    在使用 GCP 的 API 时,您有时会遇到非常神秘的错误,这有点典型。

    【讨论】:

      猜你喜欢
      • 2020-01-05
      • 2021-11-19
      • 1970-01-01
      • 2019-05-26
      • 2022-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多