Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker] gunicorn启动无法在后台加载模型 #107

Open
Artrajz opened this issue Nov 29, 2023 · 0 comments
Open

[Docker] gunicorn启动无法在后台加载模型 #107

Artrajz opened this issue Nov 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Artrajz
Copy link
Owner

Artrajz commented Nov 29, 2023

运行环境

  • 操作系统 (Linux/macOS/Windows):Linux
  • 部署方式 (Docker/windows快速部署包/自己搭的环境):Docker
  • Python 版本 (如果是部署包可不填):3.10.11
  • 代码版本/部署包版本: 923f468

问题描述

猜测是由于使用了gunicorn冻结一个主进程,再fork出多个子进程的方式,来实现共享模型内存,因此在使用gunicorn启动时,无法在运行中进入后台加载模型。

目前可使用的解决方法:

  1. 提前在config.yml中配置好模型再启动,并且不使用后台的加载模型。
  2. 在docker-compose.yaml中加入启动命令command: ['python', 'app.py'],使用flask内置服务器启动。
@Artrajz Artrajz added the bug Something isn't working label Nov 29, 2023
@Artrajz Artrajz changed the title gunicorn启动无法在后台加载模型 [Docker] gunicorn启动无法在后台加载模型 Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant