【发布时间】:2019-04-05 21:09:56
【问题描述】:
我正在部署一个烧瓶网络应用程序,其中包含使用 xgboost 训练的机器学习模型。在本地工作正常,使用 Azure App services linux 机器时出错。
似乎没有正确安装 xgboost。我也无法使用他们的 web SSH 对其进行故障排除,因为它每隔几秒就会断开连接。有人知道如何解决吗?
错误:
2019-04-05T20:46:57.927633884Z /home/site/wwwroot/antenv/lib/python3.7/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
2019-04-05T20:46:57.927671786Z import imp
2019-04-05T20:46:57.927678286Z [2019-04-05 20:46:57 +0000] [39] [ERROR] Exception in worker process
2019-04-05T20:46:57.927682786Z Traceback (most recent call last):
2019-04-05T20:46:57.927686887Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-04-05T20:46:57.927691387Z worker.init_process()
2019-04-05T20:46:57.927695487Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
2019-04-05T20:46:57.927700087Z self.load_wsgi()
2019-04-05T20:46:57.927703987Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2019-04-05T20:46:57.927715888Z self.wsgi = self.app.wsgi()
2019-04-05T20:46:57.927720188Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-04-05T20:46:57.927724388Z self.callable = self.load()
2019-04-05T20:46:57.927728188Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2019-04-05T20:46:57.927732288Z return self.load_wsgiapp()
2019-04-05T20:46:57.927736189Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2019-04-05T20:46:57.927740389Z return util.import_app(self.app_uri)
2019-04-05T20:46:57.927744389Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
2019-04-05T20:46:57.927748389Z __import__(module)
2019-04-05T20:46:57.927752289Z File "/home/site/wwwroot/app.py", line 4, in
2019-04-05T20:46:57.927756789Z import xgboost as xgb
2019-04-05T20:46:57.927760690Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/xgboost/__init__.py", line 11, in
2019-04-05T20:46:57.927764990Z from .core import DMatrix, Booster
2019-04-05T20:46:57.927768990Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/xgboost/core.py", line 136, in
2019-04-05T20:46:57.927773190Z _LIB = _load_lib()
2019-04-05T20:46:57.927776990Z File "/home/site/wwwroot/antenv/lib/python3.7/site-packages/xgboost/core.py", line 128, in _load_lib
2019-04-05T20:46:57.927781090Z lib.XGBGetLastError.restype = ctypes.c_char_p
2019-04-05T20:46:57.927784991Z UnboundLocalError: local variable 'lib' referenced before assignment
【问题讨论】:
-
您是否要将带有 xgboost 模型的烧瓶应用部署到 Linux 上的应用服务?请参考docs.microsoft.com/en-us/azure/app-service/containers/… 和docs.microsoft.com/en-us/azure/app-service/containers/… 告诉我你做了什么尝试。
-
我尝试了第二部分:使用 Azure DevOps 构建部署 (docs.microsoft.com/en-us/azure/app-service/…)。
标签: python azure azure-web-app-service xgboost