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: Unable to predict model eos481p on CLI due to UnboundLocal Error #412

Closed AnneO1 closed 1 year ago

AnneO1 commented 1 year ago

Describe the bug.

Error during predict on model eos481p after successful fetch and serve.

See attached error log.

Describe the steps to reproduce the behavior

  1. conda activate ersilia
  2. ersilia -v fetch eos481p : model fetched successfully
  3. ersilia -v serve eos41p : model served successfully
  4. ersilia -v api predict -i "eml_canonical.csv" -o "eos481p_221022_cli" > eos481p.log 2>&1 : error

Expected behavior.

Model predicted successfully

Screenshots.

eos481p.log

Operating environment

WSL Ubuntu 20.04

Additional context

Model predicted successfully on Google Colab.

conda v: conda 22.9.0 git-lfs -v: git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5) python v: Python 3.7.13

GemmaTuron commented 1 year ago

Hi @AnneO1 ,

Just to confirm before we look into this any further, the serve command was done with the correct model identifier and this is only a typo? ersilia -v serve eos41p

Also, your output file does not specify which type of file it is, it is not automatically inferred so I am guessing this might be the cause of the problem.

I'd suggest:

  1. DO NOT fetch the model again as the model is fetched successfully
  2. DO serve the model using the correct model id:ersilia -v serve eos481p
  3. Test only one molecule as input, for example "CCCC" first without output file specified (result will print on the screen only) ersilia -v api predict -i "CCCCCC" > eos481p.log 2>&1
  4. Test only one molecule as input, for example "CCCC" and try to save the output ersilia -v api predict -i "CCCCCC" -o "mycsvfile**.csv** > eos481p.log 2>&1
AnneO1 commented 1 year ago

Hi @AnneO1 ,

Just to confirm before we look into this any further, the serve command was done with the correct model identifier and this is only a typo? ersilia -v serve eos41p

Hi too @GemmaTuron, was manually writing the commands, definitely a typo. The serve command ersilia -v serve eos481p did run successfully with an API: 'predict' output.

Side note: model eos77w8 also gave the same error log: UnboundLocal on running third step(Predict).

GemmaTuron commented 1 year ago

can you do the tests suggested above and report? thanks!

AnneO1 commented 1 year ago

Hi @AnneO1 ,

Just to confirm before we look into this any further, the serve command was done with the correct model identifier and this is only a typo? ersilia -v serve eos41p

Also, your output file does not specify which type of file it is, it is not automatically inferred so I am guessing this might be the cause of the problem.

I'd suggest:

  1. DO NOT fetch the model again as the model is fetched successfully
  2. DO serve the model using the correct model id:ersilia -v serve eos481p
  3. Test only one molecule as input, for example "CCCC" first without output file specified (result will print on the screen only) ersilia -v api predict -i "CCCCCC" > eos481p.log 2>&1
  4. Test only one molecule as input, for example "CCCC" and try to save the output ersilia -v api predict -i "CCCCCC" -o "mycsvfile**.csv** > eos481p.log 2>&1

Hi @GemmaTuron, did the above test on one molecule as requested. It ran successfully. See attached csv and log file.

eos481p.log eos481p_2410222_cli.csv

GemmaTuron commented 1 year ago

Perfect, we can close this issue and mark the model as complete in the excel