Bug when loading keras model under keras2.3.0 and TensorFlow2.0
See original GitHub issueSummary
Bug when loading keras model under keras2.3.0 and TensorFlow2.0 if using st.button.
Steps to reproduce
import keras
import streamlit as st
def main():
model = keras.applications.mobilenet.MobileNet(input_shape=None, alpha=1.0,
depth_multiplier=1, dropout=1e-3, include_top=True,
weights='imagenet', input_tensor=None, pooling=None, classes=1000)
st.title("test")
st.subheader(" test")
st.subheader(" Extract from Your Text ")
message = st.text_area(" Entre Your Text ", " ")
if st.button("Extract"):
st.write(message)
if __name__ == '__main__':
main()
What are the steps we should take to reproduce the bug:
- load a keras model under keras2.3.0 and TensorFlow2.0.
- streamlit run app.py
- input some characters.
- click the Extract button.
- Error occurs. Any ideas? Thanks a lot.
AttributeError: ‘_thread._local’ object has no attribute ‘value’ Traceback: File “C:\Users\lxy\AppData\Roaming\Python\Python36\site-packages\streamlit\ScriptRunner.py”, line 311, in _run_script exec(code, module.dict)
Debug info
- Streamlit version: (get it with
$ streamlit version
) => 0.51.0 - Python version: (get it with
$ python --version
) => 3.6 - Using Conda? PipEnv? PyEnv? Pex? => Conda
- OS version: => win10
- Browser version: => chrome
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Unable to load Keras model in Keras 2.4.3 (with Tensorflow ...
I am able to load the model using Keras to 2.1.0. So the real question is - what changed in Keras/Tensorflow, and is...
Read more >Save and load a model using a distribution strategy
This tutorial demonstrates how you can save and load models in a SavedModel format with tf.distribute.Strategy during or after training.
Read more >Keras vs. tf.keras: What's the difference in TensorFlow 2.0?
In this tutorial you'll discover the difference between Keras and tf.keras. You'll also learn what's new in TensorFlow 2.0.
Read more >Introduction to TensorFlow2.0 and Keras with MNIST dataset
ADDITIONALLY WE WILL WALK THROUGH ON HOW YOU CAN LOAD IN YOUR OWN IMAGE , RESIZE IT USING OPENCV AND MAKE THE MODEL...
Read more >A detailed example of how to use data generators with Keras
python keras 2 fit_generator large dataset multiprocessing ... dataset on multiple cores in real time and feed it right away to your deep...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jrhone Thanks a lot. Hope someone can give me some suggestions!
@jrhone @monchier Thanks a lot. I think it is a special case I encounted. When i load a simple model, it is all ok. Maybe the complex model structure causes the error. It may be difficult to repro and i will not dig into this error. Close the issue.