0

I'm using flask as the web server running keras with tensor flow backend. Every time I restart it, it shows up like this:

enter image description here

Does this mean that Tensorflow is loading twice? Or is it because I'm running it in PyCharm and the debugger is active - how can I disable it? The 3 lines below don't come up when running on IDLE. Tensorflow takes quite a while to load, so it would be great if I can only have it load once.

Thank you for any comment and suggestions.

matchifang
  • 5,190
  • 12
  • 47
  • 76
  • 2
    Its a flask issue, check http://stackoverflow.com/questions/28241989/flask-app-restarting-with-stat and http://stackoverflow.com/questions/25855997/python-flask-restarting-with-reloader-what-does-that-mean – Alok Nayak Feb 03 '17 at 12:08
  • That seem to work. Thank you for your comment @AlokNayak :) – matchifang Feb 05 '17 at 00:51

1 Answers1

2

I ran into the same error. In my case it was because predict was called in a different thread than the one in which load_model was called. Moved them to the same thread the the problem was gone.

Kenneth Jiang
  • 589
  • 7
  • 13