ersilia-os / ersilia

The Ersilia Model Hub, a repository of AI/ML models for infectious and neglected disease research.
https://ersilia.io
GNU General Public License v3.0
203 stars 131 forks source link

🐛 Bug: Ersilia stuck in Endless loop of execution while Predicting model: "|DEBUG| Status code: 200" #348

Closed ZakiaYahya closed 1 year ago

ZakiaYahya commented 1 year ago

Describe the bug.

@Gemma Suddenly my installed Ersilia model hub behaving weird. i have successfully fetched all my assigned models, and i predicted all as well except one because it took so much time to predict like whole night and day, it seems like it hangs somewhere in between. So, for checking purpose i've predict the model again that i was already predicted successfully. But the same things is happening with that model too. It seems like it stucks in a endless loop of execution. I've close ersilia for all models but no effect. Although everything was working perfectly fine before. That's why i have to abort the execution because it stucks in the endless loop of printing "| DEBUG | Status code: 200" & "| DEBUG | Status code: 500" over and over again and after doing this for 8-10 hours it just got stuck at this " | DEBUG | Status code: 200" giving me no error .

Screenshot 2022-10-15 120916

Describe the steps to reproduce the behavior

No response

Expected behavior.

No response

Screenshots.

No response

Operating environment

Window 10 pro , WLS ubuntu 18.04

Additional context

No response

Femme-js commented 1 year ago

Hi @ZakiaYahya

The same happened with one of my models. I left it overnight to get executed and got the output. You might just want to leave it for some more hours.

Also, I guess this is because the predictions are not done in batched but one by one for some models. @GemmaTuron Can this be a possibility?

GemmaTuron commented 1 year ago

Hi @ZakiaYahya ! What model is this? Actually, you can have a deep dive into Ersilia's code and check what the Status Code 200 means. @Femme-js good guess

Ersilia tries to run all the molecules in batch, but if it gets problems, i.e cannot make predictions for one molecule (error code 500) , it will start going one by one, and giving you the outcome (status code:200). All the predictions will be finally saved in the file. To check this, try and run simply the first molecule in the list (copy and paste it after the -i "molecule" in brackets). If this works, just mark the model as working and I'll do the calculation for all molecules. So Status Code 200 is goooood

GemmaTuron commented 1 year ago

Please let me know which model is it and if one molecule works, and we can close the issue

ZakiaYahya commented 1 year ago

Hi @ZakiaYahya ! What model is this? Actually, you can have a deep dive into Ersilia's code and check what the Status Code 200 means. @Femme-js good guess

Ersilia tries to run all the molecules in batch, but if it gets problems, i.e cannot make predictions for one molecule (error code 500) , it will start going one by one, and giving you the outcome (status code:200). All the predictions will be finally saved in the file. To check this, try and run simply the first molecule in the list (copy and paste it after the -i "molecule" in brackets). If this works, just mark the model as working and I'll do the calculation for all molecules. So Status Code 200 is goooood

Hi @GemmaTuron. The model in which i'm getting this issue is "eos526j". I've predict that model for just first one molecule of test input file (i.e. time ersilia -v api predict -i "Nc1nc(NC2CC2)c2ncn([C@H]3C=CC@@HC3)c2n1" -o check_eos526j.csv) and i'm getting an error "TypeError: 'NoneType' object is not subscriptable". For countercheck i've run predict on model "eos2v11" which i predicted successfully before as well for same first molecule (i.e. time ersilia -v api predict -i "Nc1nc(NC2CC2)c2ncn([C@H]3C=CC@@HC3)c2n1" -o check2.csv) and it's working, giving me correct output.

I'm attaching my screenshots here, kindly have a look, (for model "eos526j" giving error) eos526j_log1

and for model "eos2v11" giving correct output eos2v11_log2

GemmaTuron commented 1 year ago

Thanks @ZakiaYahya very helpful!! Two things:

  1. Run the prediction for a very easy molecule "CCCCC" see if it also crashes
  2. Collect the log file for the prediction as well (add the same flag to save the log file at the end of the api command)
ZakiaYahya commented 1 year ago

Thanks @ZakiaYahya very helpful!! Two things:

  1. Run the prediction for a very easy molecule "CCCCC" see if it also crashes
  2. Collect the log file for the prediction as well (add the same flag to save the log file at the end of the api command)

@GemmaTuron getting the same error "TypeError: 'NoneType' object is not subscriptable" while running prediction on molecule "CCCCC" using model "eos526j". I'm attaching the log file,

eos526j_log.log

GemmaTuron commented 1 year ago

Hi @ZakiaYahya thanks for the test, it seems it is still due to the output format. If you do not add a .csv requirement in the output, so it will just be printed in the CLI, is the error persisting?

ersilia -v api predict -i "CCCCC" #do not add output

ZakiaYahya commented 1 year ago

Hi @ZakiaYahya thanks for the test, it seems it is still due to the output format. If you do not add a .csv requirement in the output, so it will just be printed in the CLI, is the error persisting?

ersilia -v api predict -i "CCCCC" #do not add output

Hi @GemmaTuron, yes without adding .csv requirement, it gave me output. I have open another issue i.e. #377 with more detail on this model, which is sorted now. So, i'm closing this issue.