New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Gunicorn with Flask to serve a Pytorch Model #2157
Comments
what do you mean by "But I am not able to infer it ." does it fails? |
Yes it fails. |
do you have a trace of the failure? what does it raises?
On Mon 11 Nov 2019 at 04:50 gvskalyan ***@***.***> wrote:
Yes it fails.
But works in the other two cases.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2157?email_source=notifications&email_token=AAADRIXBUKCTZXPQQX5RRH3QTDI65A5CNFSM4JLDFBUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDVSU6Q#issuecomment-552282746>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADRIUZYX5UOSKPPAIMXC3QTDI65ANCNFSM4JLDFBUA>
.
--
Sent from my Mobile
|
Does this mean that the issue can be closed? |
Can you please address why this does not work with not having threads?
|
The default, synchronous worker will be killed if it does not generate a response within the timeout (default 30s). The threaded worker can signal liveness on a separate thread, so it generally does not time out (unless there is a bug in the interpreter, or unsafe C code that leads to a deadlock, or something like this). How long do your requestts take? |
It depends on no of words present in a sentence. But for the same sentence which took around 250 ms for serving the inference. The default setting with sync workers got timedout. |
Reload is incompatible with preload. |
closing the issue as it seems answered. Feel free to reopen it if needed. |
gunicorn is used as gunicorn app:app --preload --workers 3
Preload is used to share the resources among the workers.
Set the OMP_NUM_THREADS to 2.
app.py contains the following code
model.pt is created using create_model.py containing
But I am not able to infer it .
Instead of using a torch model if I use some numpy operation and just return its output, it is able to.
Thanks.
The text was updated successfully, but these errors were encountered: