Model = joblib.load('/home/ncpd241/Service/SI_MODEL_FINAL.pkl') error


#1

/home/ncpd241/Service/service.py:20: FutureWarning: Passing a negative integer is deprecated in version 1.0 and will not be supported in future version. Instead, use None to not limit the column width.
pd.set_option(‘display.max_colwidth’, -1)
Traceback (most recent call last):
File “/home/ncpd241/Service/service.py”, line 367, in
service(sys.argv[1])
File “/home/ncpd241/Service/service.py”, line 355, in service
POLNUM, prediction_score, prediction_STP = predict_application(policy_all_features)
File “/home/ncpd241/Service/service.py”, line 330, in predict_application
model = joblib.load(’/home/ncpd241/Service/SI_MODEL_FINAL.pkl’)
File “/usr/local/lib/python3.6/dist-packages/joblib/numpy_pickle.py”, line 605, in load
obj = _unpickle(fobj, filename, mmap_mode)
File “/usr/local/lib/python3.6/dist-packages/joblib/numpy_pickle.py”, line 529, in _unpickle
obj = unpickler.load()
File “/usr/lib/python3.6/pickle.py”, line 1050, in load
dispatchkey[0]
File “/usr/local/lib/python3.6/dist-packages/joblib/numpy_pickle.py”, line 342, in load_build
Unpickler.load_build(self)
File “/usr/lib/python3.6/pickle.py”, line 1507, in load_build
setstate(state)
File “/usr/local/lib/python3.6/dist-packages/xgboost/core.py”, line 1094, in setstate
_LIB.XGBoosterUnserializeFromBuffer(handle, ptr, length))
File “/usr/local/lib/python3.6/dist-packages/xgboost/core.py”, line 189, in _check_call
raise XGBoostError(py_str(LIB.XGBGetLastError()))
xgboost.core.XGBoostError: [11:57:39] /workspace/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_model from 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.html

for reference to the script, and more details about differences between saving model and
serializing.