GoogleCloudPlatform / vertex-pipelines-end-to-end-samples

Apache License 2.0
225 stars 89 forks source link

XGBoost prediction pipeline fails #26

Closed ghost closed 1 year ago

ghost commented 1 year ago

The batch prediction job for the XGBoost pipeline fails (model server never becomes ready). Manually tested deploying to an endpoint and got this error:

ERROR:root:Failed to load model: Could not load the model: /tmp/model/0001/model.joblib. __new__() argument after ** must be a mapping, not numpy.ndarray. (Error code: 0)

This appears to be a common issue with scikit-learn - loading the model only works if the exact same library versions are used in training and prediction

Workaround

Use the serving container image (europe-docker.pkg.dev/vertex-ai/prediction/sklearn-cpu.0-24:latest) for the XGBoost training component. In pipelines/kfp_components/xgboost/train.py and pipelines/kfp_components/xgboost/predict.py: