Following Keras function (predict) works when called synchronously
pred = model.predict(x)
But it does not work when called from within an asy
I got the reference from this Blog
GRAPH = tf.get_default_graph() with GRAPH.as_default(): pred = model.predict return pred
But Celery uses processes to manage all its worker pools. So at this point, things are still not working on Celery for that you need to use gevent or eventlet library
pip install gevent
now run celery as :
celery -A mysite worker --pool gevent -l info