Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python environment for ClassicalGSG #1

Open
fwaibl opened this issue Sep 27, 2023 · 8 comments
Open

Python environment for ClassicalGSG #1

fwaibl opened this issue Sep 27, 2023 · 8 comments

Comments

@fwaibl
Copy link

fwaibl commented Sep 27, 2023

Hi,

I would like to use ClassicalGSG to predict logP values of small molecules. However, I am unable to get any non-NaN results. I could imagine that this is because of version mismatches of some Python packages.

I currently have:

  • Python 3.8 (with 3.7 I got "ImportError: cannot import name 'cached_property' from 'functools'").
  • skorch 0.10.0
  • scikit-learn 0.24.2
  • torch 1.12.1

When I try to run ClassicalGSG on benzene, I get the following output:

$ python -m LogpPredictor benzene.mol2 benzene.str                                                                                                                                                                                                                                 
/localhome/fwaibl/.conda/envs/classicalgsg/lib/python3.8/site-packages/classicalgsg/molreps_models/gsg.py:64: RuntimeWarning: Precision loss occurred in moment calculation due to catastrophic cancellation. This occurs when the data are nearly identical. Results may be unreliable.                                                                                                                                                                                                                                                                              
  features.append(stats.skew(wavelet_signal, axis=1, bias=False))                                                                                                                                                                                                                  
/localhome/fwaibl/.conda/envs/classicalgsg/lib/python3.8/site-packages/classicalgsg/molreps_models/gsg.py:65: RuntimeWarning: Precision loss occurred in moment calculation due to catastrophic cancellation. This occurs when the data are nearly identical. Results may be unreliable.                                                                                                                                                                                                                                                                              
  features.append(stats.kurtosis(wavelet_signal, axis=1, bias=False))                                                                                                                                                                                                              
/localhome/fwaibl/.conda/envs/classicalgsg/lib/python3.8/site-packages/classicalgsg/molreps_models/gsg.py:84: RuntimeWarning: Precision loss occurred in moment calculation due to catastrophic cancellation. This occurs when the data are nearly identical. Results may be unreliable.                                                                                                                                                                                                                                                                              
  features.append(stats.skew(coefficents, axis=1, bias=False))                                                                                                                                                                                                                     
/localhome/fwaibl/.conda/envs/classicalgsg/lib/python3.8/site-packages/classicalgsg/molreps_models/gsg.py:85: RuntimeWarning: Precision loss occurred in moment calculation due to catastrophic cancellation. This occurs when the data are nearly identical. Results may be unreliable.                                                                                                                                                                                                                                                                              
  features.append(stats.kurtosis(coefficents, axis=1, bias=False))                                                                                                                                                                                                                 
/localhome/fwaibl/.conda/envs/classicalgsg/lib/python3.8/site-packages/sklearn/base.py:310: UserWarning: Trying to unpickle estimator StandardScaler from version 0.23.2 when using version 0.24.2. This might lead to breaking code or invalid results. Use at your own risk.     
  warnings.warn(                                                                                                                                                                                                                                                                   
Predicted logP value is: nan

The same also happens with the MMFF94 version, and also with less symmetric molecules (e.g., pyridine)
Do you know which versions of pytorch etc. I should have installed to use ClassicalGSG?

Best regards,
Franz

@ndonyapour
Copy link
Collaborator

Hi @fwaibl,
I'm trying reproduce the error. Would it be possible for you to share the input files (benzene.mol2 and benzene.str)?

Thanks,
Nazanin

@fwaibl
Copy link
Author

fwaibl commented Oct 2, 2023 via email

@ndonyapour
Copy link
Collaborator

I was able to reproduce the error you are getting. This error is caused by models that were trained with an outdated version of PyTorch. As Python 3.7 is no longer supported, we will need to train our models with higher versions of PyTorch. I am currently working on training new models and will upload them as soon as they are available. Additionally, I will create a tutorial on how to train the ClassicalGSG models.

@alexrd
Copy link
Contributor

alexrd commented Oct 9, 2023

Hi @fwaibl , please let us know if this fixes the issue for you!

@fwaibl
Copy link
Author

fwaibl commented Oct 9, 2023

Hi. Thanks for your help. I installed the new version, but now I get the following error message:

FileNotFoundError: [Errno 2] No such file or directory: '/localhome/fwaibl/.conda/envs/classicalgsg/lib/python3.10/site-packages/classicalgsg/pretrained_models/model_4_zfs_MMFF.pkl'

Do I need to re-train the model myself, or should the file be included?

@ndonyapour
Copy link
Collaborator

Hi @fwaibl I forgot to push the new trained models. I'll update them.

@fwaibl
Copy link
Author

fwaibl commented Oct 9, 2023

Hi. I just installed the fix_issue_1 branch, and now it seems to work. Thanks for your help!

@alexrd alexrd modified the milestone: Specify versions of packages Oct 12, 2023
@alexrd
Copy link
Contributor

alexrd commented Oct 12, 2023

Todo: help future-proof this by specifying the versions of different packages in setup.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants