I am having an issue using Universal Sentence Encoder(USE) Multilingual inside a flask app. I am using it with TF2.
When I initialize the flask app and load the USE model using hub.load() and then call it on text to get the embeddings, it works perfectly fine.
But when I use that same object inside a request, it does not work. I see no errors coming and after some time the flask app sends a connection error.
ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Correction: All things works fine when launching flask alone. But when I wrap the flask app using uwsgi, I face the problem as mentioned above.
uwsgi --http :5000 --logger file:logfile=/tmp/uwsgi.log,maxsize=1000000000,backupname=/tmp/uwsgi.log.rotated --manage-script-name --wsgi-file main-app.py --callable app --processes 2 --enable-threads --listen 128 &
Let me know if anyone has faced similar issue before.