问题描述
我能够使用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)"
[[]]
我尝试使用如下所示的其他输入json格式,但是没有用-
{"instances": [{"values": [[40,0]],"key": 1}]}
解决方法
与Gcp预测环境相比,您的训练中的xgboost版本可能有所不同