在本地,当我使用它解开我的 sklearn 模型时,joblib.load()
它工作得很好。我已将其部署到 S3 并将其加载到 Heroku 上的烧瓶应用程序中(我已确保它正常工作)。
但是,当我heroku logs
在部署后运行时,我看到以下内容classifier = joblib.load(classifierFile)
:
016-04-02T09:39:28.232162+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-04-02T09:39:28.232163+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-04-02T09:39:28.232164+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-04-02T09:39:28.232165+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232164+00:00 app[web.1]: __import__(module)
2016-04-02T09:39:28.232165+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232166+00:00 app[web.1]: File "/app/app.py", line 38, in <module>
2016-04-02T09:39:28.232167+00:00 app[web.1]: classifier = joblib.load(classifierFile)
2016-04-02T09:39:28.232167+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 425, in load
2016-04-02T09:39:28.232168+00:00 app[web.1]: obj = unpickler.load()
2016-04-02T09:39:28.232168+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/pickle.py", line 864, in load
2016-04-02T09:39:28.232169+00:00 app[web.1]: dispatch[key](self)
2016-04-02T09:39:28.232170+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/pickle.py", line 1096, in load_global
2016-04-02T09:39:28.232170+00:00 app[web.1]: klass = self.find_class(module, name)
2016-04-02T09:39:28.232171+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/pickle.py", line 1130, in find_class
2016-04-02T09:39:28.232171+00:00 app[web.1]: __import__(module)
2016-04-02T09:39:28.232172+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232172+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232173+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/sklearn/linear_model/__init__.py", line 15, in <module>
2016-04-02T09:39:28.232174+00:00 app[web.1]: from .least_angle import (Lars, LassoLars, lars_path, LarsCV, LassoLarsCV,
2016-04-02T09:39:28.232174+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232175+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232176+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/sklearn/linear_model/least_angle.py", line 24, in <module>
2016-04-02T09:39:28.232176+00:00 app[web.1]: from ..utils import arrayfuncs, as_float_array, check_X_y
2016-04-02T09:39:28.232177+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232177+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232178+00:00 app[web.1]: ImportError: /app/.heroku/python/lib/python2.7/site-packages/sklearn/utils/arrayfuncs.so: undefined symbol: cblas_drot
2016-04-02T09:39:28.232179+00:00 app[web.1]: Traceback (most recent call last):
2016-04-02T09:39:28.232179+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2016-04-02T09:39:28.232180+00:00 app[web.1]: worker.init_process()
2016-04-02T09:39:28.232180+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 201, in init_process
2016-04-02T09:39:28.232181+00:00 app[web.1]: super(GeventWorker, self).init_process()
2016-04-02T09:39:28.232181+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2016-04-02T09:39:28.232182+00:00 app[web.1]: self.load_wsgi()
2016-04-02T09:39:28.232183+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2016-04-02T09:39:28.232183+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2016-04-02T09:39:28.232184+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-04-02T09:39:28.232184+00:00 app[web.1]: self.callable = self.load()
2016-04-02T09:39:28.232185+00:00 app[web.1]: return self.load_wsgiapp()
2016-04-02T09:39:28.232185+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-04-02T09:39:28.232186+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-04-02T09:39:28.232187+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-04-02T09:39:28.232187+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-04-02T09:39:28.232188+00:00 app[web.1]: __import__(module)
2016-04-02T09:39:28.232189+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232189+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232190+00:00 app[web.1]: File "/app/app.py", line 38, in <module>
2016-04-02T09:39:28.232193+00:00 app[web.1]: classifier = joblib.load(classifierFile)
2016-04-02T09:39:28.232194+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 425, in load
2016-04-02T09:39:28.232195+00:00 app[web.1]: obj = unpickler.load()
2016-04-02T09:39:28.232195+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/pickle.py", line 864, in load
2016-04-02T09:39:28.232196+00:00 app[web.1]: dispatch[key](self)
2016-04-02T09:39:28.232196+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/pickle.py", line 1096, in load_global
2016-04-02T09:39:28.232197+00:00 app[web.1]: klass = self.find_class(module, name)
2016-04-02T09:39:28.232198+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/pickle.py", line 1130, in find_class
2016-04-02T09:39:28.232198+00:00 app[web.1]: __import__(module)
2016-04-02T09:39:28.232199+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232199+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232200+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/sklearn/linear_model/__init__.py", line 15, in <module>
2016-04-02T09:39:28.232201+00:00 app[web.1]: from .least_angle import (Lars, LassoLars, lars_path, LarsCV, LassoLarsCV,
2016-04-02T09:39:28.232201+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232202+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232203+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/sklearn/linear_model/least_angle.py", line 24, in <module>
2016-04-02T09:39:28.232203+00:00 app[web.1]: from ..utils import arrayfuncs, as_float_array, check_X_y
2016-04-02T09:39:28.232204+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
2016-04-02T09:39:28.232205+00:00 app[web.1]: result = _import(*args, **kwargs)
2016-04-02T09:39:28.232205+00:00 app[web.1]: ImportError: /app/.heroku/python/lib/python2.7/site-packages/sklearn/utils/arrayfuncs.so: undefined symbol: cblas_drot
2016-04-02T09:39:28.232384+00:00 app[web.1]: [2016-04-02 09:39:28 +0000] [11] [INFO] Worker exiting (pid: 11)
2016-04-02T09:39:28.276851+00:00 app[web.1]: Traceback (most recent call last):
2016-04-02T09:39:28.276883+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2016-04-02T09:39:28.276889+00:00 app[web.1]: sys.exit(run())
2016-04-02T09:39:28.276889+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2016-04-02T09:39:28.276893+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2016-04-02T09:39:28.276895+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run
2016-04-02T09:39:28.276933+00:00 app[web.1]: super(Application, self).run()
2016-04-02T09:39:28.276935+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
2016-04-02T09:39:28.276962+00:00 app[web.1]: Arbiter(self).run()
2016-04-02T09:39:28.276964+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 206, in run
2016-04-02T09:39:28.277007+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2016-04-02T09:39:28.277030+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 302, in halt
2016-04-02T09:39:28.277073+00:00 app[web.1]: self.stop()
2016-04-02T09:39:28.277075+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 347, in stop
2016-04-02T09:39:28.277135+00:00 app[web.1]: time.sleep(0.1)
2016-04-02T09:39:28.277137+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 219, in handle_chld
2016-04-02T09:39:28.277175+00:00 app[web.1]: self.reap_workers()
2016-04-02T09:39:28.277186+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 464, in reap_workers
2016-04-02T09:39:28.277243+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2016-04-02T09:39:28.277280+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2016-04-02T09:39:29.110131+00:00 heroku[web.1]: State changed from up to crashed
2016-04-02T09:39:29.103179+00:00 heroku[web.1]: Process exited with status 1
请帮忙。