gpt4 book ai didi

python-3.x - 如何修复 "Celery is receiving tasks but while executing it stuck"

转载 作者:可可西里 更新时间:2023-11-01 11:23:25 24 4
gpt4 key购买 nike

我正在从事 AI 图像处理工作,我使用 Django rest 框架、Python3、tensorflow 和 keras 以及 Celery 来处理异步任务。我也在使用redis服务器。但是当我执行 celery 任务时,它正在接收任务但卡在中间。它一直在发生。我正在尝试为 amazon ec2 g3s.xlarge 实例提供它,尽管它在我的本地机器上运行良好。

我正在尝试将它部署到具有深度学习 AMI (linux) 版本的 amazon ec2 g3s.xlarge 实例中。

@task(name="predict")
def work_out(cow_front_image,cow_back_image):
return detect_cow_weight(cow_front_image,cow_back_image)

这是一个大型项目,不知道如何在此处显示所有代码。

I repeat its running fine and quite comfortably in the local machine and also I used the all the configuration from one of our existing server served product which is production grade.

我希望 celery 任务能够执行,就像我将传递两个图像作为参数然后它将处理图像并返回他在后台看到的结果。

最佳答案

我得到了修复 --pool=solo

 celery -A prodapi worker -l info --without-gossip --without-mingle --without-heartbeat -Ofair --pool=solo

关于python-3.x - 如何修复 "Celery is receiving tasks but while executing it stuck",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56696477/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com