Python 谷歌人工智能平台XGBoost-本地预测工作,但在线预测不工作

Python 谷歌人工智能平台XGBoost-本地预测工作,但在线预测不工作,python,machine-learning,xgboost,google-cloud-ml,google-ai-platform,Python,Machine Learning,Xgboost,Google Cloud Ml,Google Ai Platform,我能够生成本地预测,但不能使用gcloud对XGBoost模型进行在线预测。在线预测没有错误消息,只有空响应 局部预测- 输入json-[40,1,0,20,3,2020,4,0,0,0,0,2,0,5,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] gcloud- gcloud ai-platform local predict --model-dir <mode

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

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

gcloud-

gcloud ai-platform local predict --model-dir <model_dir> --json-instances <input_json> --framework xgboost
当我使用相同的json生成在线预测时

在线预测
gcloud-

输出-

INFO: Display format: "default table[no-heading](predictions)"
[0.3261602520942688]
INFO: Display format: "default table[no-heading](predictions)"
[[]]
我曾尝试使用GUI生成在线预测,但仍然无法获得任何结果-

我尝试过使用不同的输入json格式,如下所示,但没有任何效果-

{"instances": [{"values": [[40, 1, 0, 20, 3, 2020, 4, 0, 0, 0, 2, 0, 5, 0, 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0]], "key": 1}]}

在您的培训和Gcp预测环境中,您可能有不同版本的xgboost

{"instances": [{"values": [[40, 1, 0, 20, 3, 2020, 4, 0, 0, 0, 2, 0, 5, 0, 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0]], "key": 1}]}