【问题标题】:{"error": "Error loading the model"} when using /ml/v1beta1/ml.projects.predict{"error": "加载模型时出错"} 使用 /ml/v1beta1/ml.projects.predict
【发布时间】:2017-02-22 05:37:00
【问题描述】:

使用以下 API Explorer 和正文,我得到了错误 {"error": "加载模型时出错"}.我打算开始使用https://developers.google.com/resources/api-libraries/documentation/ml/v1beta1/python/latest/ml_v1beta1.projects.html#predict,但想先验证一切是否正常。

有没有办法查看实际错误?


https://developers.google.com/apis-explorer/?authuser=1#p/ml/v1beta1/ml.projects.predict?

POST https://ml.googleapis.com/v1beta1/projects/{project}/models/{model_name}/versions/v1:predict?key={YOUR_API_KEY}

{ “httpBody”:{ "数据": "[{\"placeholder_name\": [44, 158, 178, 156, 111, 101, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"key\": 1 }]" } }

200

缓存控制:私有 内容编码:gzip 内容长度:53 内容类型:文本/html;字符集=utf-8 日期:格林威治标准时间 2017 年 2 月 22 日星期三 05:25:14 服务器:ESF 变化:来源,X-Origin,Referer

{"error": "加载模型时出错"} `

【问题讨论】:

  • 我不认为这是导致您报告错误的问题,但是您的请求本身有几个错误,您想要:{“data”:[{“image”:[44, 158, 178, 156, 111, 101, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "键": 1}] }
  • 如果向 cloudml-feedback@ 发送您的项目、模型和版本名称以及您发送请求的大致日期/时间,我们可以调查该问题。我们还将调查未报告错误的原因。
  • 感谢您的建议,例如,占位符名称“image”已隐藏,因为我在 stackoverflow 中使用了“”符号。我也确实最终向 cloudml-feedback@gamil.com 发送了电子邮件。我期待着让这个模型上线。

标签: tensorflow google-cloud-ml google-apis-explorer


【解决方案1】:

我添加了 export.meta、export.index 和重命名的 export.data-00000-of-00001 -> 也导出云存储。

这是基于文档https://cloud.google.com/ml/docs/concepts/deployment-overview#deployment_location 的错误猜测。

所以看起来你只需要saver.save(sess, os.path.join(FLAGS.model_dir, 'export'))创建的文件

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-18
    • 1970-01-01
    • 1970-01-01
    • 2016-12-24
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    • 2021-06-25
    相关资源
    最近更新 更多