使用以下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”:{ “data”:“[{\”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,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\“键\”:1 }]” } }
200
缓存控制:私有 content-encoding:gzip 内容长度:53 content-type:text / html;字符集= utf-8的 日期:2017年2月22日星期三05:25:14 GMT 服务器:ESF 变化:原点,X-Origin,Referer
{“error”:“加载模型时出错”} `
答案 0 :(得分:0)
我添加了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'))