R - 谷歌预测 API "hello prediction"教程



我已经浏览了Google预测API教程和文档"hello prediction - https://cloud.google.com/prediction/docs/hello_world

但是,在开发人员控制台中训练模型时,我的请求失败并显示以下输出:

请求:

POST https://www.googleapis.com/prediction/v1.6/projects/959568262740/trainedmodels?key={YOUR_API_KEY}
{
 "id": "language_id",
 "storageDataLocation": "http://storage.googleapis.com/2341234/language_id.txt"
}

响应:

400 OK
- Show headers -
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Training data file is empty.",
    "locationType": "other",
    "location": "id"
   }
  ],
  "code": 400,
  "message": "Training data file is empty."
 }
}

我已经使用 OAuth 2.0 实现了授权请求: - 我是否应该做任何其他事情,或者可能在 Google PRediction API v 1.6 和教程之间发生了变化。任何指向有关该主题的任何其他教程或文章的链接也将非常有价值,因此可以调试自己!

您的存储数据位置不正确。

当您转到 Google 开发者控制台中的"概述"选项卡时,您会找到您的项目 ID:xxxxx(示例),并且您存储的存储桶称为 yyyy(示例)。

然后替换"存储数据位置:"xxxxx/yyyy"。应该解决这个问题。您需要 Google Storage 的相对路径,而不是绝对的网络路径。

相关内容

最新更新