部署H10后,Heroku将无法工作

时间:2020-02-26 18:01:37

标签: python heroku scikit-learn

首次尝试使用Heroku和Scikit-learn部署模型。当我创建并推送我的应用程序时,一切都很好。当我尝试使用我的应用程序时,收到错误消息。我运行了日志,这就是输出:

Destins-Razor-Scooter:capstone destinatterbury$ heroku logs --tail
2020-02-26T17:46:45.830001+00:00 app[api]: Release v2 created by user datterbury1@student.gsu.edu
2020-02-26T17:46:45.830001+00:00 app[api]: Enable Logplex by user datterbury1@student.gsu.edu
2020-02-26T17:46:44.975192+00:00 app[api]: Release v1 created by user datterbury1@student.gsu.edu
2020-02-26T17:46:44.975192+00:00 app[api]: Initial release by user datterbury1@student.gsu.edu
2020-02-26T17:53:32.696812+00:00 app[api]: Deployed web (514beea3ae94) by user datterbury1@student.gsu.edu
2020-02-26T17:53:32.696812+00:00 app[api]: Release v3 created by user datterbury1@student.gsu.edu
2020-02-26T17:53:32.711708+00:00 app[api]: Scaled to web@1:Free by user datterbury1@student.gsu.edu
2020-02-26T17:53:59.281408+00:00 heroku[web.1]: Starting process with command `/bin/sh -c firefly\ hate_speech.predict\ --bind\ 0.0.0.0:\25862`
2020-02-26T17:54:03.116001+00:00 app[web.1]: 2020-02-26 17:54:03 firefly [INFO] Starting Firefly...
2020-02-26T17:54:06.944988+00:00 app[web.1]: Traceback (most recent call last):
2020-02-26T17:54:06.945036+00:00 app[web.1]: File "/usr/local/bin/firefly", line 8, in <module>
2020-02-26T17:54:06.945038+00:00 app[web.1]: sys.exit(main())
2020-02-26T17:54:06.945039+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 114, in main
2020-02-26T17:54:06.945039+00:00 app[web.1]: functions = load_functions(args.functions)
2020-02-26T17:54:06.945040+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 71, in load_functions
2020-02-26T17:54:06.945043+00:00 app[web.1]: return [load_function(function_spec) for function_spec in function_specs]
2020-02-26T17:54:06.945043+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 71, in <listcomp>
2020-02-26T17:54:06.945044+00:00 app[web.1]: return [load_function(function_spec) for function_spec in function_specs]
2020-02-26T17:54:06.945044+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 61, in load_function
2020-02-26T17:54:06.945045+00:00 app[web.1]: mod = importlib.import_module(mod_name)
2020-02-26T17:54:06.945045+00:00 app[web.1]: File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
2020-02-26T17:54:06.945046+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-02-26T17:54:06.945046+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2020-02-26T17:54:06.945046+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-02-26T17:54:06.945047+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2020-02-26T17:54:06.945047+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-02-26T17:54:06.945047+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-02-26T17:54:06.945048+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-02-26T17:54:06.945048+00:00 app[web.1]: File "/hate_speech.py", line 4, in <module>
2020-02-26T17:54:06.945048+00:00 app[web.1]: clf = externals.joblib.load(model_filename)
2020-02-26T17:54:06.945049+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 598, in load
2020-02-26T17:54:06.945050+00:00 app[web.1]: obj = _unpickle(fobj, filename, mmap_mode)
2020-02-26T17:54:06.945050+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 526, in _unpickle
2020-02-26T17:54:06.945051+00:00 app[web.1]: obj = unpickler.load()
2020-02-26T17:54:06.945051+00:00 app[web.1]: File "/usr/local/lib/python3.6/pickle.py", line 1050, in load
2020-02-26T17:54:06.945051+00:00 app[web.1]: dispatch[key[0]](self)
2020-02-26T17:54:06.945052+00:00 app[web.1]: KeyError: 0
2020-02-26T17:54:07.393882+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-26T17:54:07.398191+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-26T17:54:07.375627+00:00 heroku[web.1]: Process exited with status 1
2020-02-26T17:54:25.523134+00:00 heroku[web.1]: Starting process with command `/bin/sh -c firefly\ hate_speech.predict\ --bind\ 0.0.0.0:\20910`
2020-02-26T17:54:27.684829+00:00 app[web.1]: 2020-02-26 17:54:27 firefly [INFO] Starting Firefly...
2020-02-26T17:54:28.413811+00:00 app[web.1]: Traceback (most recent call last):
2020-02-26T17:54:28.413841+00:00 app[web.1]: File "/usr/local/bin/firefly", line 8, in <module>
2020-02-26T17:54:28.413843+00:00 app[web.1]: sys.exit(main())
2020-02-26T17:54:28.413843+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 114, in main
2020-02-26T17:54:28.413844+00:00 app[web.1]: functions = load_functions(args.functions)
2020-02-26T17:54:28.413844+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 71, in load_functions
2020-02-26T17:54:28.413845+00:00 app[web.1]: return [load_function(function_spec) for function_spec in function_specs]
2020-02-26T17:54:28.413845+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 71, in <listcomp>
2020-02-26T17:54:28.413846+00:00 app[web.1]: return [load_function(function_spec) for function_spec in function_specs]
2020-02-26T17:54:28.413846+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/firefly/main.py", line 61, in load_function
2020-02-26T17:54:28.413847+00:00 app[web.1]: mod = importlib.import_module(mod_name)
2020-02-26T17:54:28.413847+00:00 app[web.1]: File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
2020-02-26T17:54:28.413847+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-02-26T17:54:28.413848+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2020-02-26T17:54:28.413848+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-02-26T17:54:28.413848+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2020-02-26T17:54:28.413849+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-02-26T17:54:28.413849+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-02-26T17:54:28.413849+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-02-26T17:54:28.413850+00:00 app[web.1]: File "/hate_speech.py", line 4, in <module>
2020-02-26T17:54:28.413850+00:00 app[web.1]: clf = externals.joblib.load(model_filename)
2020-02-26T17:54:28.413851+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 598, in load
2020-02-26T17:54:28.413852+00:00 app[web.1]: obj = _unpickle(fobj, filename, mmap_mode)
2020-02-26T17:54:28.413866+00:00 app[web.1]: File "/usr/local/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 526, in _unpickle
2020-02-26T17:54:28.413866+00:00 app[web.1]: obj = unpickler.load()
2020-02-26T17:54:28.413866+00:00 app[web.1]: File "/usr/local/lib/python3.6/pickle.py", line 1050, in load
2020-02-26T17:54:28.413867+00:00 app[web.1]: dispatch[key[0]](self)
2020-02-26T17:54:28.413868+00:00 app[web.1]: KeyError: 0
2020-02-26T17:54:28.582839+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-26T17:54:28.563420+00:00 heroku[web.1]: Process exited with status 1
2020-02-26T17:54:29.190358+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/predict" host=hsdetector.herokuapp.com request_id=aa7c5581-fabb-4d00-b3e1-38f9a917d0a5 fwd="131.96.220.16" dyno= connect= service= status=503 bytes= protocol=https
2020-02-26T17:55:00.757846+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hsdetector.herokuapp.com request_id=d189e68f-af23-402d-94a5-96f98a32c22d fwd="131.96.220.16" dyno= connect= service= status=503 bytes= protocol=https
2020-02-26T17:55:01.361243+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hsdetector.herokuapp.com request_id=412721a4-8039-4c0e-940d-edb8c06e5dc6 fwd="131.96.220.16" dyno= connect= service= status=503 bytes= protocol=https

供参考:我创建的模型正在使用本指南 https://towardsdatascience.com/creating-and-deploying-a-python-machine-learning-service-a06c341f020f

0 个答案:

没有答案