Google cloud platform AutoML对象检测接收到无效的JSON负载
在尝试运行中的沙拉示例时,我得到一个错误。成功创建数据集后,我运行curl命令导入数据:Google cloud platform AutoML对象检测接收到无效的JSON负载,google-cloud-platform,google-cloud-automl,Google Cloud Platform,Google Cloud Automl,在尝试运行中的沙拉示例时,我得到一个错误。成功创建数据集后,我运行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/${DATASET}:importData -d '{
curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" https://automl.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/us-central1/datasets/${DATASET}:importData -d '{
"input_config": {
"gcs_source": {
"input_uris": [
"gs://cloud-ml-data/img/openimage/csv/salads_ml_use.csv"
]
}
}
但是我得到了错误
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Expected an object key or }.\n \"input_config\": {\n^",
"status": "INVALID_ARGUMENT"
}
}
有什么想法吗?我尝试将
input\u config
更改为inputConfig
,但无效。您没有用关闭有效负载。
应该是这样的
curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" https://automl.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/us-central1/datasets/${DATASET}:importData -d '{
"input_config": {
"gcs_source": {
"input_uris": [
"gs://cloud-ml-data/img/openimage/csv/salads_ml_use.csv"
]
}
}'
我看不出这段代码有任何错误。检查gcs对象是否可访问。它确实存在(它来自外部打开的数据集)。最后,我通过遵循quickstart UI版本()修复了它