errException while 运行 cloud ml engine: 无法获取元素作为字节

errException while running cloud ml engine: Unable to get element as bytes

我该如何解决这个问题? 当我使用 Cloud ML 引擎启动预测时会发生此错误。

**

Exception during running the graph: Unable to get element as bytes.

**

看起来一个或多个输入被标记为 DT_STRING 类型,但您发送的是非字符串数据。虽然我没有浏览所有专栏,但我至少注意到了以下几点:

inputs['dos_cp_trav'] tensor_info:
    dtype: DT_STRING
    shape: (-1)
    name: Placeholder_43:0

您的输入 JSON 包含:

{
  ...
  "dos_cp_trav": 13009
  ...
}

您需要更改 "dos_cp_trav" 的数据类型或在 JSON 中传递一个字符串。

可能还有其他的,所以我建议你仔细检查所有输入的数据类型。您可能还会发现在将大型作业发送到云端之前使用 gcloud ml-engine local predict --json-instance=FILE 在本地进行测试很有帮助。