Input instances are not in JSON format

一世执手 提交于 2019-12-08 07:23:13

问题


I'm practicing GCP ML engine using Google's public templates and examples located here

After I ran the code in the example "housing-regression" LOCALLY, the model was successfully generated.

However, in prediction, an error was raised

ERROR: (gcloud.ml-engine.local.predict) Input instances are not in JSON format.

See "gcloud ml-engine predict --help" for details.

The codes I ran is in local-train.sh

gcloud ml-engine local predict --model-dir=${MODEL_LOCATION} --json-instances=data/new-data.json

Does anyone have the same problem? Did I make a mistake somewhere or is there some information I may have missed?

NOTES:

  1. This code is running locally on my Mac using GCP SDK which I have installed
  2. I checked the file and it is indeed a JSON file.

回答1:


For online prediction, the json needs to be one instance per line. So try removing the pretty formatting ...



来源:https://stackoverflow.com/questions/50653384/input-instances-are-not-in-json-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!