Gayathri-Selvaganapathi / emotion_based_music_recommendation

The repo contains the ml model that captures the user facial experssion and based on the detected expression ,it suggest the suitable genre of music
0 stars 0 forks source link

Streamlit WebRTC Keeps Loading - "NoneType" Attribute Error #2

Open Vedha0541 opened 4 weeks ago

Vedha0541 commented 4 weeks ago

I'm experiencing an issue where my Streamlit WebRTC app keeps loading without connecting. When I run the app locally, it gets stuck at the loading screen, and I receive the following error:

AttributeError: 'NoneType' object has no attribute 'sendto'

Traceback:

Exception in callback Transaction..._retry() ... self._sock.sendto(data, addr) AttributeError: 'NoneType' object has no attribute 'sendto'

During handling of the above exception, another exception occurred: ... AttributeError: 'NoneType' object has no attribute 'call_exception_handler' I am not sure whether this issue is related to my local setup (e.g., laptop configuration, firewall settings, Python environment) or if it's a problem with Streamlit WebRTC itself. Could you please advise on how to troubleshoot this issue or confirm if this is a known bug with Streamlit WebRTC?

Screenshot 2024-10-25 162253

Gayathri-Selvaganapathi commented 3 weeks ago

Here are the possible troubleshooting steps:

1.Python Environment: Ensure that all libraries are up to date, as streamlit-webrtc and WebRTC components frequently update to resolve connectivity issues. Update them using:

pip install --upgrade streamlit streamlit-webrtc 

Sometimes issues arise with WebRTC components if conflicting versions of dependencies are present, so a virtual environment with fresh installations might help resolve this.

2.Verify Emotion Model and Files: Ensure that model.h5, labels.npy, and emotion.npy files are correctly loaded without errors. If any of these files are missing or corrupted, they could disrupt the Streamlit WebRTC pipeline.

3.Clear Streamlit Cache and Restart: Occasionally, Streamlit caching can cause issues if the previous state doesn’t fully clear. Restart the Streamlit server and clear the cache:

streamlit cache clear
streamlit run app.py