输入实例不是JSON格式 [英] Input instances are not in JSON format
问题描述
我正在使用Google的公共模板和位于此处
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
错误:(gcloud.ml-engine.local.predict)输入实例不是JSON格式.
ERROR: (gcloud.ml-engine.local.predict) Input instances are not in JSON format.
有关详细信息,请参见"gcloud ml-engine Forecast --help".
See "gcloud ml-engine predict --help" for details.
我运行的代码在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:
- 此代码使用已安装的GCP SDK在Mac上本地运行
- 我检查了该文件,它确实是JSON文件.
推荐答案
对于在线预测,json需要每行一个实例.因此,请尝试删除漂亮的格式...
For online prediction, the json needs to be one instance per line. So try removing the pretty formatting ...
这篇关于输入实例不是JSON格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!