Closed andysharma1997 closed 5 years ago
can you try putting model in eval mode by calling roberta.eval()
to disable dropout while inferencing?
It worked now i am getting consistent result thankyou sir for the support.Can you please let me know why this issue was there or any links to read upon it
eval()
disables some features like Dropout
and BatchNorm
for inferencing.
Dropout
is only used for training as regularization and should be turned off for inference time. more details: https://discuss.pytorch.org/t/trying-to-understand-the-meaning-of-model-train-and-model-eval/20158/2
it was really helpful sir thanks a lot once again .
I tried running roberta for checking sentence similarity score and used torchvision my code look like this
when i run apache bench to test this the score value that i get is totally random this is the command that i used for apache bench marking
ab -c 10 -n 10 -v 3 -T 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' -p /home/andy/benchmark/ignore1.txt http://192.168.0.199:8080/sentence_similarity_roberta
I used gunicorn for running the service and the command that i used is :
gunicorn --threads=150 -b:8080 hello:app
The values that i got from apache are :
Please let me know why is the value of similarity score not coming same for every request Any help would be appriciated Thank you