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
'The Session graph is empty' when run behind Flask API #10585
Comments
I have the same issue,it disappeared when I update to tensorflow2.0-alpha. |
I found this to be helpful: tensorflow/tensorflow#28287 (comment) |
@eliadl sorry do you mean loading same model file in a dedicated model object in each thread? I think this is helpful but loading models sometimes is quite time consuming and might not be practical behind an API. |
@aliostad Oh sorry, I haven't really dived deep into the details of your question, just saw the same error I got. My problem was that the graph was empty on the other threads because they had different default I hope this helps. |
Try this: This solved the same error in my environment |
@eliadl Thanks Eliad. My problem was exactly the same, just the same model that could not be shared across different threads. Problem is that you could have different threads (more than 2) in flask I guess. |
So, a possible solution is to run one-threaded Flask application, using the keyword argument passed to the app, like here: |
Hi,
Following conversations on Keras gitter, I was asked to create an issue.
I am experiencing an issue similar to #5331
The code is a public github repo hexagon-rl. I am building an RL agent that can play and the player is exposed as a Flask API. I am trying the simplistic doe provided in this article as the starting point which employs two models.
The solution provided in the issue above #5331 (comment) makes sense but having two models at at the same time, means the chance of collision is very high and it can be brittle.
When I run the Centaur module which does not involve multi-threading, it works fine but the error happens when I use the API (the game itself is a separate scala project).
I appreciate if you could point me to a solution.
Thanks
Environment
Python 2.7.10 on Mac
Keras 2.1.5
Tensorflow 1.3.0
Flask: 1.0.2
The text was updated successfully, but these errors were encountered: