在Heroku上部署项目后出现内部服务器错误

时间:2020-07-14 17:12:24

标签: python heroku nlp

我已经在Heroku服务器上部署了NLP项目。如果我要通过输入字段来测试webapp,那么我会收到内部服务器错误:

The server encountered an internal error and was unable to complete your request.
Either the server is overloaded or there is an error in the application.

此应用已在本地主机上成功运行。我不知道部署后会发生什么。

有人可以帮忙吗?

这是构建的屏幕截图 [Build description

这是app.py文件的代码 enter image description here

这是spam_classifier.py的代码 enter image description here

enter image description here

这些是我放到requirements.txt上的要求 enter image description here

1 个答案:

答案 0 :(得分:0)

您的构建似乎已成功部署,但是在使用API​​时出现内部服务器错误,因此您必须检查应用程序日志而不是构建日志。为此,请在heroku仪表板中转到更多>>日志。对于您提出的每个请求,您都可以查看日志,因此可以查看运行时错误(如果有)。

其他建议

  1. 从泡菜文件中加载经过训练的模型时,在部署环境中的文件系统中不需要spam_classifier.py。
  2. 确保已将泡菜文件和代码一起推送。我建议您使用Amazon s3存储和加载此类文件