Hi guys, I’m trying to deploy my app on Streamlit cloud, but every time encountering the OSError! The app is working well in local machine and I have this issue only in cloud environment for deploying. Already tried pathlib, but still haven’t got any success to solve this problem. here is the Error message:

OSError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).


File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)File "/mount/src/image_captioning/code/streamlit.py", line 20, in <module>
    caption_model_vgg = keras.models.load_model(model_path)File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_api.py", line 262, in load_model
    return legacy_sm_saving_lib.load_model(File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from NoneFile "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/legacy/save.py", line 234, in load_model
    raise IOError(

and here is the original link of the app in cloud:


and also here is the Github link of the code:


Please help me to solve this problem! Thanks!

Thanks for posting.

The issue is with the file path. Change the paths to look like this:

model_path = 'models/caption_mode_with_vgg16.h5'


csv_file_path = 'data/cleaned_caption.csv'

Let me know if this resolves the issue.

Thank you very much, @tonykip! Following your recommended path format, I can now see that my application has been deployed flawlessly. I appreciate you taking the time to investigate my problem and share the solution. Thank you once again!

1 Like

Glad it worked @farhadfarahanii, happy Streamlit-ing! :balloon:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.