This error has been constant since deployment, and now I’m very confused at this point because I can’t really figure out what is the actual issue here.
It seems that the issue is here:
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py”, line 557, in _run_script
exec(code, module.dict)
File “st_app.py”, line 135, in
cartoon_img = cartoon_style(display_image)
File “st_app.py”, line 93, in cartoon_style
cartoon_image = cv2.stylization(image_1, sigma_s=150, sigma_r=0.25)
cv2.error: OpenCV(4.6.0) error: (-5:Bad argument) in function ‘stylization’
Odd, I just forked the repo and it deployed in Streamlit Cloud without issues. Link to app.
edit: using streamlit 1.12.2 works fine as well
edit2: without changing anything, the app now fails showing the same issue in the logs
edit3: refactored the code a little bit to reboot the app in Streamlit Cloud. It’s working again… but it might break again? I suspect the problem comes from the streamlit-image-comparison component that writes opencv images that are supposed to be temporal but are never cleaned, and possibly never released.
It’s been a couple days and the version from my fork has not failed yet. The only meaningful change was that the image processing only gets triggered when both st.button('See the Magic! 🎉') and st.file_uploader("UPLOAD AN IMAGE") evaluate to True. In the earlier version, only the st.button('See the Magic! 🎉') was checked, so if the app was run without an uploaded file, it would throw an exception.
Yes, I tried but it doesn’t seem to solve the actual issue Right now, my app is running without any issues. I’ll keep monitoring how long it works well…
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.