Build error while trying to deploy in Streamlit Cloud

Hello everyone, I’m a student new to the AI and ML field. I’ve been working on deploying my ML project, which focuses on sign language detection using the Mediapipe pipeline and LSTM. While deploying it on localhost, everything works fine. However, when attempting to deploy it on Streamlit Cloud, I encounter an issue where it shows “Building wheel for opencv-python (pyproject.toml): still running…” for a considerable amount of time before ultimately failing. I’m in urgent need of assistance as I have to submit my project tomorrow. Any help or insights would be greatly appreciated. Thank you.

github: affanmohammed/ml_streamlit (github.com)

That version of opencv-python is almost four years old. You need python<=3.8 to install a binary wheel.

1 Like

numpy==1.21.4
pickle-mixin==1.0.2
streamlit==1.2.0
opencv-python==4.8.1
matplotlib == 3.7.2

is this fine?? (requirements.txt)

Hey @affanmohammed. Use opencv-python-headless by without mentioning the version.
Hope it works

Happy Streamlit-ing :balloon:

1 Like

That I couldn’t know without trying. I generally avoid specifying package versions unless I have a good reason to. Having the app already working locally may be a reason to install the same versions in Streamlit Cloud.

2 Likes

i was able to solve some bugs with your help.
now I am facing this issue.

can you look into this and help me where I am wrong

affanmohammed/ml_streamlit (github.com)

link to my repo. pls go through it

I think you should be able to fix that by installing opencv-python-headless instead of opencv-python, as suggested by @Guna_Sekhar_Venkata.

Mmmm… or maybe not, because mediapipe may override it with its own favorite flavour of opencv. So you may need to also install libgl1 by adding it to packages.txt.

1 Like

Layer ‘lstm_cell’ expected 3 variables, but received 0 variables during loading. Expected: [‘lstm/lstm_cell/kernel:0’, ‘lstm/lstm_cell/recurrent_kernel:0’, ‘lstm/lstm_cell/bias:0’]

how to solve this issue