绑定独角兽会导致错误

时间:2019-06-12 05:52:29

标签: gunicorn

我目前正在使用flask,nginx和gunicorn托管API服务。

如果我不绑定古尼康(gunicorn wsgi:app),则可以毫无问题地向服务器发出请求。

如果我绑定古尼康(例如gunicorn --bind 0.0.0.0:5000 wsgi:app),则在我需要执行来自其他库的代码的flask应用程序的请求中遇到错误(机器学习推断):

gunicorn[17110]: [2019-06-12 05:23:58 +0000] [17110] [INFO] Starting gunicorn 19.9.0
[2019-06-12 05:23:58 +0000] [17110] [INFO] Listening at: http://0.0.0.0:5000 (17110)
[2019-06-12 05:23:58 +0000] [17110] [INFO] Using worker: sync
[2019-06-12 05:23:58 +0000] [17131] [INFO] Booting worker with pid: 17131
[2019-06-12 05:24:11,269] ERROR in app: Exception on /predict [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2311, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1834, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1737, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/root/server/app.py", line 517, in predict
    tokenization.validate_case_matches_checkpoint(FLAGS.do_lower_case,FLAGS.init_checkpoint)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/flags.py", line 84, in __getattr__
    wrapped(_sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/absl/flags/_flagvalues.py", line 633, in __call__
    name, value, suggestions=suggestions)
UnrecognizedFlagError: Unknown command line flag 'bind'

发生了什么事?我该如何解决?

Here is my flask app (see line 508)

0 个答案:

没有答案