google-cloud-platform - 使用 AutoML 对象检测接收到的 JSON 负载无效
问题描述
尝试在对象检测 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 '{
"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_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"
]
}
}'
推荐阅读
- google-bigquery - 将已分区和未分区的 BigQuery 表从美国移动到欧洲
- ios - 尝试将 json 发布到服务器 Code=3840 时出错
- html - 如何使选项卡的内容从页面的开头开始而不是在中心?
- swift - MVP - 在 iOS 中关闭时从 View Controller 中销毁 Presenter 对象
- odoo - 无法在 qweb 中设置宽度
- facebook-graph-api - Facebook 图形 API 资源管理器返回 /me/family 的空列表
- angular - 使用 Angular material2 创建粘性按钮元素
- java - galssfish本地路径配置
- wordpress - Gravity Forms Repeater Add-On » 单击添加按钮时出现 JQuery 错误
- c# - 元素 c# 表单信息