I’m having an issue when I try to use a conditional statement to display text. My code is as follows:
st.header('Expected Winnings Based on Risk Profile')
option = st.radio("What level of risk would you like to adopt?",("High","Medium","Low"))
if option == "High":
st.write("Your expected returns are: ",High_Risk_Winnings)
elif option == "Medium":
st.write("Your expected returns are: ",Medium_Risk_Winnings)
else:
st.write("Your expected returns are: ",Low_Risk_Winnings)
High / Medium / Low _Risk_Winnings are all objects from my preceding code.
Once I’ve run the code, when I click on one of the radio buttons I get the following error message: AttributeError: ‘_thread._local’ object has no attribute 'value’
I tried running your code snippet and can’t reproduce the error. But after looking at the traceback you provided and doing a little more research, I think this is a Keras issue related to version 2.3.0 of Keras.
Is that the version you’re using? If so, can you try 2.2.5 or 2.3.1?
The previously proposed solution did not satisfied me as i did not want to downgrade Keras and TF. After searching online, I found this fix, which worked for me :
I’m using keras 2.3.1, tensorflow 2.0.0, python 3.6, linux Mint 19.2 Cinnamon.
My project is based on Waitress, so I can’t use “threaded=False”.
I found an UGLY workaround…
In the main “post manager” function I put this code…
import keras.backend.tensorflow_backend as tb tb._SYMBOLIC_SCOPE.value = True
And this solved the problem for me…
I hope it will be useful to find a solution
By @ccasadei
I hope this can be a solution for others having the same problem as us.
from tensorflow.keras.applications.vgg16 import VGG16
instead of:
from keras.applications.vgg16 import VGG16
Although it was working in one folder right but not another.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.