0

I am saving a Naive Bayes classifier with Joblib.dump. Each time my machine is run, it loads the model with joblib.load(filename). This was working for a while but I started getting this error:

File "test.py", line 92, in categorize
subclf = joblib.load('/home/elalo/ServiceNow/multinomial.pkl')
 File "/usr/lib64/python3.4/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 575, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/usr/lib64/python3.4/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 507, in _unpickle
    obj = unpickler.load()
  File "/usr/lib64/python3.4/pickle.py", line 1038, in load
    dispatch[key[0]](self)
KeyError: 253

I currently have Scikit-learn (0.18.1), scipy (0.19.1).

I'm not really sure what the problem is. Any help would be appreciated.

thanks!

Evan Lalo
  • 1,209
  • 1
  • 14
  • 34
  • Have you updated any library, mainly numpy, scipy or scikit-learn, or maybe python? – Vivek Kumar Jan 03 '18 at 05:38
  • Yeah, all modules are up to date and I'm running python 3.4. I tried using `pickle.load` instead and I got an `unpickling error` . – Evan Lalo Jan 03 '18 at 12:31
  • What I meant is, from the time you dumped (pickled) the data into the file, is the environment still the same or has it changed? Because if its changed, it may have problem unpickling the data which was saved with older versions. – Vivek Kumar Jan 03 '18 at 12:36
  • Ah, I understand. Nothing has been updated to my knowledge. I am just going to rebuild my model, I can do that fairly quickly. Thanks for your help. – Evan Lalo Jan 03 '18 at 13:21

0 Answers0