我正在尝试加载腌制的ML模型,并将其保存到My Flask应用程序的静态文件夹中。
我尝试使用“莳萝”包保存模型,该模型也面临相同的导入问题。
我都丢失了“ _iterative”包而导致导入错误? 我试图将模型加载到Jupyter笔记本中,并且效果很好。
builtins.ImportError
ImportError: DLL load failed: Le module spécifié est introuvable.
Traceback (most recent call last)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\_compat.py", line 35, in reraise
raise value
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\_compat.py", line 35, in reraise
raise value
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\waad\Anaconda3\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\waad\Anaconda3\lib\site-packages\flask_login\utils.py", line 261, in decorated_view
return func(*args, **kwargs)
File "C:\Users\waad\Desktop\Malou\1. CTO\1. APPS\Projets\dream-team\app\admin\views.py", line 482, in add_review
print(predict_sentiment(review))
File "C:\Users\waad\Desktop\Malou\1. CTO\1. APPS\Projets\dream-team\app\admin\algos.py", line 257, in predict_sentiment
loaded_model = joblib.load(f)
File "C:\Users\waad\Anaconda3\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 588, in load
obj = _unpickle(fobj)
File "C:\Users\waad\Anaconda3\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 526, in _unpickle
obj = unpickler.load()
File "C:\Users\waad\Anaconda3\lib\pickle.py", line 1085, in load
dispatch[key[0]](self)
File "C:\Users\waad\Anaconda3\lib\pickle.py", line 1373, in load_global
klass = self.find_class(module, name)
File "C:\Users\waad\Anaconda3\lib\pickle.py", line 1423, in find_class
__import__(module, level=0)
File "C:\Users\waad\Anaconda3\lib\site-packages\sklearn\__init__.py", line 64, in <module>
from .base import clone
File "C:\Users\waad\Anaconda3\lib\site-packages\sklearn\base.py", line 13, in <module>
from .utils.fixes import signature
File "C:\Users\waad\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 16, in <module>
from .fixes import _Sequence as Sequence
File "C:\Users\waad\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 85, in <module>
from scipy.special import boxcox # noqa
File "C:\Users\waad\Anaconda3\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: Le module spécifié est introuvable.
非常感谢您的帮助!