8000 Can't reload old model with joblib · Issue #14724 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
8000

Can't reload old model with joblib #14724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
weber8thomas opened this issue Aug 22, 2019 · 1 comment
Closed

Can't reload old model with joblib #14724

weber8thomas opened this issue Aug 22, 2019 · 1 comment

Comments

@weber8thomas
Copy link
weber8thomas commented Aug 22, 2019

Hello everyone,

I have a problem with the update that consists to call directly joblib instead of calling it from sklearn.externals.

Here's my issue :

I stored a model with scikit version 0.20.3 by using scikit.externals joblib dump function. I updated my packages and it's now not possible to retrieve my model.

Traceback (most recent call last):
  File "/gstock/biolo_datasets/variation/benchmark/RADMEL/FINAL_DATA/VarClass_RADMEL/VarClass.py", line 617, in <module>
    testing(arg_dict)
  File "/gstock/biolo_datasets/variation/benchmark/RADMEL/FINAL_DATA/VarClass_RADMEL/VarClass.py", line 115, in testing
    threshold=ARGS['threshold']
  File "/enadisk/gstock/biolo_datasets/variation/benchmark/RADMEL/FINAL_DATA/VarClass_RADMEL/VarClass_scripts/testing.py", line 57, in __init__
    classifiers = self.load_classifiers(model_dir=model)
  File "/enadisk/gstock/biolo_datasets/variation/benchmark/RADMEL/FINAL_DATA/VarClass_RADMEL/VarClass_scripts/testing.py", line 82, in load_classifiers
    sk_model = joblib.load(mod)
  File "/home/weber/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 598, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/home/weber/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 526, in _unpickle
    obj = unpickler.load()
  File "/home/weber/anaconda3/lib/python3.7/pickle.py", line 1088, in load
    dispatch[key[0]](self)
  File "/home/weber/anaconda3/lib/python3.7/pickle.py", line 1376, in load_global
    klass = self.find_class(module, name)
  File "/home/weber/anaconda3/lib/python3.7/pickle.py", line 1426, in find_class
    __import__(module, level=0)
ModuleNotFoundError: No module named 'sklearn.ensemble.voting_classifier'

I think the problem comes from a mispelling link to the last line above. In documentation, the class is called by the following :
from sklearn.ensemble import VotingClassifier

Thanks in advance for your help !

Best regards,

Thomas

@amueller
Copy link
Member

We don't support loading across versions:
https://scikit-learn.org/dev/modules/model_persistence.html

The module was moved here #12513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0