Flask and Keras model Error ''_thread._local' object has no attribute 'value''? Flask and Keras model Error ''_thread._local' object has no attribute 'value''? flask flask

Flask and Keras model Error ''_thread._local' object has no attribute 'value''?


So after a long night,Keras had released a new version 2.3.0 in Sep 17,19. As part of revision update I did, I updated all libraries, Keras among them. Since I did it the message appeared.

After I downgraded back to Keras 2.2.5 The problem disappeared.


If it is still relevant, I fixed this problem just by changing

from keras.models import Sequentialfrom keras.layers import Dense, Dropout, LSTM

to

from tensorflow.keras.models import Sequentialfrom tensorflow.keras.layers import Dense, Dropout, LSTM

So, no need to turn off multithreading.


I had the same problem when building a docker container today, which had worked perfectly before. Fixed it by downgrading Keras version to 2.2.4.