当我尝试推送到Heroku时,最终从Heroku中收到以下错误:
2020-09-27T03:25:45.438184+00:00 app[web.1]: File "vocab.pyx", line 580, in spacy.vocab.unpickle_vocab
2020-09-27T03:25:45.438185+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/srsly/_pickle_api.py", line 23, in pickle_loads
2020-09-27T03:25:45.438185+00:00 app[web.1]: return cloudpickle.loads(data)
2020-09-27T03:25:45.438190+00:00 app[web.1]: ValueError: unsupported pickle protocol: 5
2020-09-27T03:25:45.439685+00:00 app[web.1]: [2020-09-27 03:25:45 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-09-27T03:25:45.628478+00:00 app[web.1]: [2020-09-27 03:25:45 +0000] [4] [INFO] Shutting down: Master
2020-09-27T03:25:45.628589+00:00 app[web.1]: [2020-09-27 03:25:45 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-09-27T03:25:45.721505+00:00 heroku[web.1]: Process exited with status 3
2020-09-27T03:25:45.761594+00:00 heroku[web.1]: State changed from up to crashed
2020-09-27T03:25:46.921727+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=twitoff-nwdelafu-update.herokuapp.com request_id=61e845a8-7c5d-4f68-9361-7ebaa3f25978 fwd="67.172.225.60" dyno= connect= service= status=503 bytes= protocol=https
2020-09-27T03:32:06.131669+00:00 heroku[web.1]: State changed from crashed to starting
2020-09-27T03:32:25.886974+00:00 heroku[web.1]: Starting process with command `gunicorn twitoff:APP -t 120`
2020-09-27T03:32:28.640745+00:00 app[web.1]: [2020-09-27 03:32:28 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-09-27T03:32:28.641640+00:00 app[web.1]: [2020-09-27 03:32:28 +0000] [4] [INFO] Listening at: http://0.0.0.0:49264 (4)
2020-09-27T03:32:28.641959+00:00 app[web.1]: [2020-09-27 03:32:28 +0000] [4] [INFO] Using worker: sync
2020-09-27T03:32:28.647830+00:00 app[web.1]: [2020-09-27 03:32:28 +0000] [10] [INFO] Booting worker with pid: 10
2020-09-27T03:32:28.699152+00:00 app[web.1]: [2020-09-27 03:32:28 +0000] [11] [INFO] Booting worker with pid: 11
2020-09-27T03:32:30.128740+00:00 heroku[web.1]: State changed from starting to up
我已尝试在转储python模型时更改协议,但仍然无法正常工作。我尝试了每种协议,并附加了我的Pipfile来显示依赖关系。
我如何创建泡菜文件:
nlp = en_core_web_sm.load()
<---这是一个预先创建的nlp SpaCy模型
`file = open(“ nlp_model_sm_5”,“ wb”)'
pickle.dump(nlp, file, protocol=5)
Pipfile:
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
flask = "*"
jinja2 = "*"
tweepy = "*"
psycopg2 = "*"
flask-sqlalchemy = "*"
gunicorn = "*"
scikit-learn = "*"
python-dotenv = "*"
spacy = "*"
pickle5 = "*"
[requires]