【发布时间】:2019-08-24 23:21:53
【问题描述】:
Google ML Engine 上的批量预测引发异常。
我在 Google ML 引擎上有一个 tensorflow 模型。我的模型对图像进行推断。输入不是一个普通的数组。该模型只接受图片的 b64 编码字符串。
我的输入是托管在 Google Cloud Platform 上的存储桶中的文本文件。 该文件如下所示:
{"image": "b64 encoded image string", "key": "0"}
{"image": "b64 encoded image string", "key": "1"}
{"image": "b64 encoded image string", "key": "2"}
输出应该是所有图像的 infrence,但我得到以下异常:
('Exception during running the graph: Expected image (JPEG, PNG, or GIF), got unknown format starting with \'{\\"image\\": \\"/9j/4\'\n\t [[node encoder/map/while/DecodeJpeg (defined at /usr/local/lib/python2.7/dist-packages/google/cloud/ml/prediction/frameworks/tf_prediction_lib.py:210) ]]', 1)
【问题讨论】:
-
您在提交工作时使用的数据格式是什么?是 JSON 吗?
-
是的,我提交作业时数据格式是JSON。
标签: python tensorflow google-cloud-ml