ersilia-os / eos96ia

Explainable AI for CYP3A4 inhibition prediction
MIT License
0 stars 0 forks source link

New model ready for testing! #3

Closed github-actions[bot] closed 11 months ago

github-actions[bot] commented 1 year ago

This model is ready for testing. If you are assigned to this issue, please try it out using the CLI, Google Colab and DockerHub and let us know if it works!

febielin commented 11 months ago

Hi all,

This model is giving this error on Colab: descriptor '__init__' requires a 'Exception' object but received a 'str'

Here is the Colab notebook and the full error:

Screenshot 2023-08-01 at 3 25 28 PM
febielin commented 11 months ago

I reran the Colab notebook and it was successful! Here are the results.

I will post the CLI and Docker outputs when they are finished.

febielin commented 11 months ago

Here is Docker and CLI results. The model works well!

GemmaTuron commented 11 months ago

@simrantan

Can you check the outputs on the CLI using your windows system so we can close this issue? Thanks!

simrantan commented 11 months ago

yes absolutely! I ran it on CLI and I recieved this error:

Ersilia exception class:
EmptyOutputError

Detailed error:
Model API eos96ia:run did not produce an outputTraceback (most recent call last):
  File "/home/simran/eos/repository/eos96ia/20230803135002_EA863B/eos96ia/artifacts/framework/code/main.py", line 12, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'

Full error log here: eos96iaerrorlog.txt

It seems that there is an issue with importing torch? possibly the version installed in the dockerfile is not properly working or is incompatible with another dependency which could be the cause of this error

simrantan commented 11 months ago

I just tested the model on Colab and Docker as well to see and it works on those platforms - Colab Output Docker eos96iaDocker.txt

GemmaTuron commented 11 months ago

Hi @simrantan Thanks, this is surprising since the fetching, if nothing is specified, will fetch the Docker container which in principle is running? Which command did you use to fetch the model exactly?

GemmaTuron commented 11 months ago

Hi @pittmanriley

I can confirm I get the Torch install error as well, could you please check and provide a torch version that works? This is what I get:

PackagesNotFoundError: The following packages are not available from current channels:
  - pytorch=1.4.0
pittmanriley commented 11 months ago

Hi @GemmaTuron @simrantan, I'm unable to fetch in my CLI, so I tried fetching it in Codespaces and it works, even with current torch version 1.4.0.

When I was refactoring the model, I was unable to find versions of each of the packages that all worked when I ran using CLI, so I just decided to stick with Codespaces. How should we proceed from here?

GemmaTuron commented 11 months ago

I am finding the torch incompatibility in my Linux and Mac but the tests were passed? 🤔

I am bringing to the discussion @HellenNamulinda maybe you could have a look at this model when you have time

HellenNamulinda commented 11 months ago

Let me try it on my end. But first, I think it would have been better to install torch using pip instead of conda as the version seems quite old, and new conda versions fail to install old versions of the packages. On Colab, installation is always successful because of a lower version of conda installed on Colab.

pittmanriley commented 11 months ago

@HellenNamulinda that makes sense. I tried installing version 1.11.0 with pip in Codespaces, and it worked. I'm keeping the rest of the package installations with conda, though.

I'll submit the PR and see if this works for you too @GemmaTuron.

HellenNamulinda commented 11 months ago

Hi @pittmanriley, The conda installs need to be changed to pip. The most critical package version is dgl==0.4.3.post2(can't be changed, otherwise, automated actions(github action will fail)).
The following worked for model eos43at,

RUN pip install rdkit==2022.9.5 
RUN pip install dgl==0.4.3.post2
RUN pip install dgllife==0.2.3
RUN pip install torch==1.9.0

And has also been tested for this model; eos96ia_fetch_local.log

(ersilia) hellenah@hellenah-elitebook:~/Outreachy$ ersilia -v fetch eos96ia --repo_path eos96ia > eos96ia_fetch_local.log 2>&1
(ersilia) hellenah@hellenah-elitebook:~/Outreachy$ ersilia serve eos96ia
🚀 Serving model eos96ia: molgrad-cyp3a4

   URL: http://127.0.0.1:54881
   PID: 13795
   SRV: conda

👉 To run model:
   - run

💁 Information:
   - info
(ersilia) hellenah@hellenah-elitebook:~/Outreachy$ ersilia run -i "O=C(c1ccc(F)cc1)N1CCC[C@H](c2nc(-c3ccc(F)cc3)no2)C1"
{
    "input": {
        "key": "VXQCCZHCFBHTTD-HNNXBMFYSA-N",
        "input": "O=C(c1ccc(F)cc1)N1CCC[C@H](c2nc(-c3ccc(F)cc3)no2)C1",
        "text": "O=C(c1ccc(F)cc1)N1CCC[C@H](c2nc(-c3ccc(F)cc3)no2)C1"
    },
    "output": {
        "probability": 0.9997186064720154
    }
} 

Changing the rdkit version for these models is okay. While the models were trained using rdkit 2019, the RDKit version and the number of descriptors it provides do not impact the predictions. The RDKit functions utilized in this code are mainly for the calculation of global features(net_utils.py) like Molecular Weight (MolWt), Topological Polar Surface Area (CalcTPSA), logarithm of the partition coefficient; LogP (MolLogP), and the number of hydrogen bond donors (NumHDonors).

Unfortunately, we won't have a docker image for these. version dgl==0.4.3.post2 is too old to be installed on arch linux(ERROR: Could not find a version that satisfies the requirement dgl==0.4.3.post2 (from versions: 1.0.1, 1.1.0, 1.1.1))

I'm tagging @febielin and @ZakiaYahya for the other molgrad models eos1af5 and eos6ao8.

pittmanriley commented 11 months ago

@HellenNamulinda thank you for this amazing work! I updated the Dockerfile with this information and submitted a new PR.

GemmaTuron commented 11 months ago

Thanks @HellenNamulinda and @pittmanriley ! I'll merge the PR and test it on my Linux once more

GemmaTuron commented 11 months ago

I have tested and it works fine, we can close this issue!