Open jruokola opened 3 years ago
Just ran in to this issue too when experimenting with upgrading a Pipelines example from XGBoost v1.0-1
to 1.3-1
. As discussed here on StackOverflow, it seems that in v1.3+ XGBoost changed the default model save format and therefore the way you'll need to load the artifact.
In particular, this answer using load_model
instead of pickle seemed to work well for me:
import xgboost
model_path = "/opt/ml/processing/model/model.tar.gz"
with tarfile.open(model_path) as tar:
tar.extractall(path="..")
model = xgboost.Booster()
model.load_model("xgboost-model")
Stumbled upon this while trying to evaluate my xgboost model ` model = pickle.load(open("./data/xgboost-model", "rb"))
UnpicklingError: unpickling stack underflow`
I get this same error while doing evaluation with a script processor on SageMaker Pipelines or trying to run it locally.
I'm running the abalone example evaluation script