Google AI Platform XGBoost-本地预测有效,但在线预测无效

问题描述

我能够使用gcloud生成XGBoost模型的本地预测,但无法生成在线预测。在线预测没有错误消息,只有空响应

本地预测-
输入json-[40,1,20,3,2020,4,2,5,6,0]

gcloud-

gcloud ai-platform local predict --model-dir <model_dir> --json-instances <input_json> --framework xgboost

输出-

INFO: Display format: "default table[no-heading](predictions)"
[0.3261602520942688]

当我使用相同的json生成在线预测时

在线预测
gcloud-

gcloud ai-platform predict --model $MODEL_NAME --version $VERSION_NAME --json-instances test_json_modified.json

输出-

INFO: Display format: "default table[no-heading](predictions)"
[[]]

我尝试使用GUI生成在线预测,但是仍然无法获取任何内容-

enter image description here

我尝试使用如下所示的其他输入json格式,但是没有用-

{"instances": [{"values": [[40,0]],"key": 1}]}

解决方法

与Gcp预测环境相比,您的训练中的xgboost版本可能有所不同

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...