I am looking to load in a model and am having trouble because the model that is was made with an older version of XGBoost. I have gone on their website and looked, but it does not give clear direction on what syntax will properly fix this and load the model properly. I also did not realize that XGBoost was even required when loading with joblib
Below is the code:
def init():
global model
model_path = 'C:\\Users\\ow\\Documents\\Test_Classification_Model\\3rd\\model_AutoMLe8aaac5a731.pkl'
model = joblib.load(model_path)
init()
And this is the error:
raise XGBoostError(py_str(_LIB.XGBGetLastError())) xgboost.core.XGBoostError: [15:33:27] C:\Users\Administrator\workspace\xgboost-win64_release_1.0.0\src\learner.cc:682: Check failed: header == serialisation_header_:
If you are loading a serialized model (like pickle in Python) generated by older XGBoost, please export the model by calling
Booster.save_modelfrom that version first, then load it back in current version. There's a simple script for helping the process. See:https://xgboost.readthedocs.io/en/latest/tutorials/saving_model.htmlfor reference to the script, and more details about differences between saving model and serializing.