Samriddhi Bhrdwaj
Samriddhi Bhrdwaj

Reputation: 1

How do I download my model using wget so that I can upload it to streamlit?

I saved my emotion detection model as a .h5. It's too big to be uploaded to Github so i uploaded it to dropbox and used wget to download the model, so that I can deploy it to streamlit. This is my code:

if not os.path.exists("models/emotion_detection_model_for_streamlit.h5"):
    with st.spinner("Loading model..."):
        os.system("wget --no-check-certificate -O 
models/emotion_detection_model_for_streamlit.h5 \"link-to-model"")

model = tf.keras.models.load_model("models/emotion_detection_model_for_streamlit.h5")

When deploying the app via streamlit, I am getting the following error: link to error message from streamlit

[manager] Python dependencies were installed from /app/emotion-in-motion-2/requirements.txt using pip. [manager] Processed dependencies! 2022-02-11 10:34:22.712519: W tensorflow/stream executor/platform/default/do loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libel 2022-02-11 10:34:22.712601: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. sh: 1: wget: not found 2022-02-11 10:34:25.828 Uncaught app exception Traceback (most recent call last): File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py" line 350, in run_script exec (code, module. dict_) File "/app/emotion-in-motion-2/app.py", line 30, in model = tf.keras.models.load_model("models/emotion_detection_model_for_streamlit.h5") File "/home/appuser/venv/lib/python3.7/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered _tb) from None File "/home/appuser/venv/lib/python3.7/site-packages/keras/saving/save.py" line 204, in load model raise I0Error (f'No file or directory found at {filepath_str}') OSError: No file or directory found at models/emotion _detection_model_for_streamlit.h5 [client] Connecting... sh: 1: wget: not found 2022-02-11 10:34:33.564 Uncaught app exception Traceback (most recent call last) : File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py" line 350, in run_script exec (code, module. dict. File "/app/emotion-in-motion-2/app.py" , line 30. in «module> model =tf.keras.models.load_model("models/emotion_detection_model_for_streamlit.h5") File "/home/appuser/venv/lib/python3.7/site-packages/keras/utils/traceback_utils.py",line67,inerror_handler raise e.with_traceback(filtered_tb) from None File "/home/appuser/venv/lib/python3.7/site-packages/keras/saving/save.py",line 204, in load model raise I0Error (f' No file or directory found at {filepath_str}' OSError: No file or directory found at models/emotion_detection model_for_streamlit.h5

Please help

Upvotes: 0

Views: 756

Answers (1)

user2314737
user2314737

Reputation: 29337

It looks like the wget command is not found. You could try to use curl instead.

Upvotes: 1

Related Questions