Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 谷歌预测api“;“你好,预测”;辅导的_R_Prediction - Fatal编程技术网

R 谷歌预测api“;“你好,预测”;辅导的

R 谷歌预测api“;“你好,预测”;辅导的,r,prediction,R,Prediction,我已经浏览了Google Prediction API教程和“hello Prediction- 但是,在开发人员控制台中培训模型时,我的请求失败,输出如下: 请求: POST https://www.googleapis.com/prediction/v1.6/projects/959568262740/trainedmodels?key={YOUR_API_KEY} { "id": "language_id", "storageDataLocation": "http://storag

我已经浏览了Google Prediction API教程和“hello Prediction-

但是,在开发人员控制台中培训模型时,我的请求失败,输出如下:

请求:

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和教程之间可能已经做了更改。任何指向此主题的其他教程或文章的链接都非常有价值,因此可以自己调试!

您的storageDataLocation不正确。

当您转到Google开发者控制台中的Overview选项卡时,您会发现您的项目ID:xxxxx(示例),并且您存储的bucket名为yyy(示例)

然后替换“storageDataLocation:”xxxxx/yyyy“。应该可以解决此问题。您需要Google存储的相对路径,而不是绝对web路径