Я обучил модель на Google Colab и хочу загрузить ее на свой локальный компьютер. Но я получаю ModuleNotFoundError: No module named 'sklearn.svm._classes'
. Загрузка модели на colab, не проблема.
colab:
[1] import sys
sys.version
'3.6.9 (default, Nov 7 2019, 10:44:02) \n[GCC 8.3.0]'
[2] import joblib
import numpy as np
from sklearn import svm
clf = svm.SVC(gamma=0.001)
clf.fit(np.random.rand(9,8).astype(int), np.arange(9))
joblib.dump(clf, 'simple_classifier')
[3] joblib.load('simple_classifier')
Моя локальная машина:
>>> import sys
>>> sys.version
'3.6.9 (default, Nov 7 2019, 10:44:02) \n[GCC 8.3.0]'
>>> import numpy as np
>>> import joblib
>>> from sklearn import svm
>>> joblib.load('simple_classifier')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/.../ml-env/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 605, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "/home/.../ml-env/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 529, in _unpickle
obj = unpickler.load()
File "/usr/lib/python3.6/pickle.py", line 1050, in load
dispatch[key[0]](self)
File "/usr/lib/python3.6/pickle.py", line 1338, in load_global
klass = self.find_class(module, name)
File "/usr/lib/python3.6/pickle.py", line 1388, in find_class
__import__(module, level=0)
ModuleNotFoundError: No module named 'sklearn.svm._classes'