我在以下代码中收到此错误
from sklearn.externals import joblib
from gensim.models import Word2Vec
filename2 = 'Models/mpl_model.sav'
loaded_model2 = joblib.load(filename2)
modell= Word2Vec.load("Models/cbow.model")
我正在尝试从“模型”文件夹中加载模型。我不断收到错误消息
TypeError: 'errstate' object is not callable
追踪
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mr_toot/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 605, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "/home/mr_toot/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 529, in _unpickle
obj = unpickler.load()
File "/home/mr_toot/anaconda3/lib/python3.7/pickle.py", line 1088, in load
dispatch[key[0]](self)
File "/home/mr_toot/anaconda3/lib/python3.7/pickle.py", line 1376, in load_global
klass = self.find_class(module, name)
File "/home/mr_toot/anaconda3/lib/python3.7/pickle.py", line 1426, in find_class
__import__(module, level=0)
File "/home/mr_toot/anaconda3/lib/python3.7/site-packages/numpy/random/_pickle.py", line 2, in <module>
from .philox import Philox
File "philox.pyx", line 1, in init numpy.random.philox
File "bit_generator.pyx", line 397, in init numpy.random.bit_generator
TypeError: 'errstate' object is not callable
更新:
通过升级numpy解决了该错误。使用新版本转储了模型,并且 我正在使用旧版本加载它。