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
220 stars 147 forks source link

🐛 Bug: Model `eos6m4j` : ModuleNotFoundError: No module named 'dataclasses' on Colab #387

Closed Zainab-ik closed 1 year ago

Zainab-ik commented 2 years ago

Describe the bug.

Hi @GemmaTuron, While fetching the model eos6m4j on colab, I got the error

ModuleNotFoundError: No module named 'dataclasses'

Error message:

🚫 expected str, bytes or os.PathLike object, not NoneType

Link to the colab eos6m4j

I believe the error is from the model since I was able to fetch one of my models successfully and 4 other random models.

This model also crashes my system on CLI, see #350 while I don't have any antivirus.

Describe the steps to reproduce the behavior

[ ] Install Ersilia on Google Colab. [ ] Connect Colab to the Drive, and specify the path to the input file: [ ] Convert your input file from csv to a smiles list to pass to Ersilia Models.

Expected behavior.

Model fetched succesfully

Screenshots.

image

Operating environment

Google Colab

Additional context

alaminumar commented 2 years ago

I also get this same error with eos7a04. Have you fixed the problem ?

GemmaTuron commented 2 years ago

Hi @Zainab-ik and @alaminumar ! I have also been able to reproduce this error on Colab, so we are on the same page here.

I've marked this issue for further examination, mark it in purple in the excel!

Zainab-ik commented 2 years ago

I've marked purple.

DhanshreeA commented 1 year ago

With updated miniconda installer script as in #367 the dataclasses issue seems to be resolved however running into installation issues with numpy as a dependency of bentoml

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/local/envs/eos6m4j/lib/python3.6/site-packages/numpy-1.19.5.dist-info/METADATA'
GemmaTuron commented 1 year ago

this latest seems due to the clash with python 3.6, I am not sure why bentoML is looking at python 3.6 at this moment

GemmaTuron commented 1 year ago

Hi @DhanshreeA !

Can you investigate this? When I run your notebook with the updated py3.9 miniconda, I get the following: ! python --version Python 3.8.15 ! conda --version /bin/bash: conda: command not found ! pip --version pip 21.1.3 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

But when I run this Miniconda installer: MINICONDA_INSTALLER_SCRIPT=Miniconda3-py37_4.12.0-Linux-x86_64.sh ! python --version Python 3.7.13 ! conda --version conda 4.12.0 ! pip --version pip 21.2.2 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)

It seems something is happening with py3.9 because conda is actually not installed and python is 3.8, enither 3.9 or 3.7

DhanshreeA commented 1 year ago

@GemmaTuron that was a silly mistake from my end :sweat_smile:

%env MINICONDA_INSTALLER_SCRIPT=Miniconda3-py39_4.12.0-Linux-x86_64.sh # Or Miniconda3-latest-Linux-x86_64.sh

The comment there starting with #... is being picked up as part of the env variable. Let me change that and you can run it again. The Python 3.8 then is likely from Colab's runtime.

GemmaTuron commented 1 year ago

Thanks @DhanshreeA

With this model i get stuck at numpy not being found, either with miniconda py3.7 or py3.9. ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/local/envs/eos6m4j/lib/python3.6/site-packages/numpy-1.19.5.dist-info/METADATA' I don't unserdtand by is the model looking at py3.6 though

miquelduranfrigola commented 1 year ago

What is the current status of this issue?

DhanshreeA commented 1 year ago

Even with the PYTHONPATH fix from @carcablop this is still running into the numpy installation error.

DhanshreeA commented 1 year ago

@miquelduranfrigola @GemmaTuron Is this something we want to take up in the bentoml sprint?

GemmaTuron commented 1 year ago

Hi, I think we solved the path problem but I am finding an issue with numpy in several occasions: ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/local/envs/eos6m4j/lib/python3.6/site-packages/numpy-1.19.5.dist-info/METADATA'

I've read this is likely because the path is too large... but on Windows? Do you know if Colab would be having the same problems?

AhmedYusuff commented 1 year ago

Hi @GemmaTuron ,

Describe the Bug

  1. Trying to fetch Model eos6m4j on Linux multiple times on different network will produce this error ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')). new.log

  2. Running the model on Google Colab produces this raise JSONDecodeError("Expecting value", s, err.value). https://colab.research.google.com/drive/1_anC9_E-Sr5rI61HicGGcCQ8bPPLWOsq#scrollTo=mWRZdAMkmgxZ

To Reproduce

Steps to reproduce the behaviour

Testing Environment

Expected Behaviour

eos6m4j fetched successfully.

Solutions

GemmaTuron commented 1 year ago

Hi @AhmedYusuff !

The first error seems due to an internet connection - this model is quite large, so it could be possible! About the error on Colab, could you share the logs as well? You can use the same command as on Linux, just need to check the saving folder location (tip: on the left hand side, there is a folder icon that will show you the folder structure of colab) Or at least print the output in the cell -- in the current link I only see the successful fetch of eos481p

AhmedYusuff commented 1 year ago

Hi @AhmedYusuff !

The first error seems due to an internet connection - this model is quite large, so it could be possible! About the error on Colab, could you share the logs as well? You can use the same command as on Linux, just need to check the saving folder location (tip: on the left hand side, there is a folder icon that will show you the folder structure of colab) Or at least print the output in the cell -- in the current link I only see the successful fetch of eos481p

Hi @GemmaTuron. This is the error log of the model on colab. eos6m4j.log

I'm Looking into the issue of the error message on linux.

GemmaTuron commented 1 year ago

Hi @AhmedYusuff

The notebook you are using has a slight different ersilia installation I think. Can you try with the most updated version and see if the error persists? https://github.com/ersilia-os/ersilia/blob/master/notebooks/ersilia-on-colab.ipynb

AhmedYusuff commented 1 year ago

@GemmaTuron. The Model eos6m4j

Hi @AhmedYusuff

The notebook you are using has a slight different ersilia installation I think. Can you try with the most updated version and see if the error persists? https://github.com/ersilia-os/ersilia/blob/master/notebooks/ersilia-on-colab.ipynb

Many Thanks @GemmaTuron. That seems to be the case, I've been able to fetch the model successfully on Colab.

eos6m4jfetch.log

The serve Command Returns 2 API's (Descriptor's and Fingerprints"s), that means I'll be generating two predictions right?

AhmedYusuff commented 1 year ago

I'm getting this error message while using the descriptors API AssertionError: More than one API found, please specificy api_name

https://colab.research.google.com/drive/1Dn015bcIU8NwCxB_sXwttJ9yTrmvom8l?usp=sharing

@GemmaTuron , from what I can see regarding this, there seems to be a conflict in the notebook with the variable name api and the model method attribute api which is denying the api variable access to the functions defined in the package.

The Model ran successfully when I change the model attribute to descriptors and Fingerprints successfully. Below is the output of the predictions

Descriptors eos6m4j_output.csv

Fingerprints [Uploading Fingerpeos6m4j_output.csv…]()

AhmedYusuff commented 1 year ago

@GemmaTuron, Can I make a PR regarding the Ersilia Colab Notebook?

From what I can see, the Notebook has been using line 168 in model.py if api_name is None: 169 api_names = self.autoservice.get_apis() for making predictions on Models.

This can be resolved by using the getattr() to make the variable access the method attribute.

GemmaTuron commented 1 year ago

Thanks @AhmedYusuff, we are actually modifying all models to run without needing to specify the API, so this will be taken care of! Great to hear the model is working on colab, I'll close this issue then!