谷歌云ml引擎预测失败

时间:2018-10-31 07:57:27

标签: python tensorflow google-cloud-platform object-detection object-detection-api

我是Tensorflow的新手,并跟随this Google博客将我的对象检测模型部署到GCP并尝试获取预测。在终端中运行$ gcloud ml-engine predict --model=${YOUR_MODEL} --version=${YOUR_VERSION} --json-instances=inputs.json 命令以运行预测时,出现以下错误:

 {
  "error": "Prediction failed: Error processing input: Expected uint8, got '\\xff\\xd8\\xff\\xe0.....\\xd9' of type 'str' instead."
 }

我的 inputs.json 文件具有输入图像的base64编码形式,可在以下内容上运行预测:

{"b64": "/9j/4AAQSk....QB//9k="}

这里出了什么问题,我该如何解决?

更新:我刚刚发现 inputs.json 中输入图像的格式为

{"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]} 来自this文档中。但是我仍然遇到相同的错误。

0 个答案:

没有答案