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

WARNING:root:No normalization for BCUT2D_MWHI #113

Closed
hmmm7 opened this issue Nov 26, 2020 · 10 comments · Fixed by #128
Closed

WARNING:root:No normalization for BCUT2D_MWHI #113

hmmm7 opened this issue Nov 26, 2020 · 10 comments · Fixed by #128

Comments

@hmmm7
Copy link

hmmm7 commented Nov 26, 2020

hello! when I use chemprop to practice, there are many warnings, plz tell me how to deal them,thanks!
warnings

@hmmm7
Copy link
Author

hmmm7 commented Nov 26, 2020

WARNING:root:No normalization for BCUT2D_MWHI
WARNING:root:No normalization for BCUT2D_MWLOW
WARNING:root:No normalization for BCUT2D_CHGHI
WARNING:root:No normalization for BCUT2D_CHGLO
WARNING:root:No normalization for BCUT2D_LOGPHI
WARNING:root:No normalization for BCUT2D_LOGPLOW
WARNING:root:No normalization for BCUT2D_MRHI
WARNING:root:No normalization for BCUT2D_MRLOW
WARNING: not removing hydrogen atom without neighbors

@ikmckenz
Copy link
Contributor

Also seeing this on more than one dataset. Curious about what it is.

@hesther
Copy link
Contributor

hesther commented Jan 9, 2021

I am so sorry for the very late response. I just did some testing. The WARNING:root:No normalization... warnings come from a third party package (namely descriptastorus), and should not cause any harm.

The WARNING: not removing hydrogen ... is a standard warning from rdkit that comes up quite often, namely whenever there is a proton in your data, e.g. "CCO.[H+]", and simply tells you that the proton is not treated as implicit but explicit hydrogen. This is no cause of concern. Due to the poor logging in rdkit, it is unfortunately very tedious to suppress this quite useless warning.

So, your code runs just fine, and I will dig a bit deeper into the descriptastorus issues later.

@hmmm7
Copy link
Author

hmmm7 commented Jan 13, 2021

I am so sorry for the very late response. I just did some testing. The WARNING:root:No normalization... warnings come from a third party package (namely descriptastorus), and should not cause any harm.

The WARNING: not removing hydrogen ... is a standard warning from rdkit that comes up quite often, namely whenever there is a proton in your data, e.g. "CCO.[H+]", and simply tells you that the proton is not treated as implicit but explicit hydrogen. This is no cause of concern. Due to the poor logging in rdkit, it is unfortunately very tedious to suppress this quite useless warning.

So, your code runs just fine, and I will dig a bit deeper into the descriptastorus issues later.

but because of these warnings, I can't predict successfully. and maybe I should download chemprop again? so that don't worry the warnings.

@hesther
Copy link
Contributor

hesther commented Jan 13, 2021

Dear hmmm7, the warnings are just printed to your terminal, and will not affect your training or prediction results. If you download chemprop again and don't install descriptastorus, the WARNING:root:No normalization will disappear, but again, this doesn't change any results. However, we recently fixed some issues with how predictions are saved and outputted, so you might benefit from downloading the latest version of Chemprop. Let me know if you have any problems!

@hmmm7
Copy link
Author

hmmm7 commented Jan 14, 2021

Dear hmmm7, the warnings are just printed to your terminal, and will not affect your training or prediction results. If you download chemprop again and don't install descriptastorus, the WARNING:root:No normalization will disappear, but again, this doesn't change any results. However, we recently fixed some issues with how predictions are saved and outputted, so you might benefit from downloading the latest version of Chemprop. Let me know if you have any problems!

dear hesther, today I try again. here are some results.
when I train the data, some warnings also exists.

(chemprop) mito@mito-ZHENGJIUZHE-REN7000P-28APR:~$ chemprop_train --data_path data/tox21.csv --dataset_type classification --save_dir tox21_checkpoints
WARNING:root:No normalization for BCUT2D_MWHI
WARNING:root:No normalization for BCUT2D_MWLOW
WARNING:root:No normalization for BCUT2D_CHGHI
WARNING:root:No normalization for BCUT2D_CHGLO
WARNING:root:No normalization for BCUT2D_LOGPHI
WARNING:root:No normalization for BCUT2D_LOGPLOW
WARNING:root:No normalization for BCUT2D_MRHI
WARNING:root:No normalization for BCUT2D_MRLOW
/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/tap/tap.py:312: UserWarning: add_arguments is deprecated and will be removed on January 1st, 2021 please override "configure" instead and call add_argument there.
warn('add_arguments is deprecated and will be removed on January 1st, 2021'
7831it [00:00, 167940.29it/s]
100%|███████████████████████████████████| 7831/7831 [00:00<00:00, 814804.76it/s]
0%| | 0/7831 [00:00<?, ?it/s][13:15:11] WARNING: not removing hydrogen atom without neighbors
[13:15:11] WARNING: not removing hydrogen atom without neighbors
100%|█████████████████████████████████████| 7831/7831 [00:01<00:00, 7064.29it/s]
100%|███████████████████████████████████████████| 30/30 [01:55<00:00, 3.85s/it]
/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/tap/tap.py:312: UserWarning: add_arguments is deprecated and will be removed on January 1st, 2021 please override "configure" instead and call add_argument there.
warn('add_arguments is deprecated and will be removed on January 1st, 2021'
19%|███████████████████████████████▌ | 3/16 [00:00<00:00, 24.29it/s][13:17:10] WARNING: not removing hydrogen atom without neighbors


so here why don't have AUC scores?

and then I predict.

(chemprop) mito@mito-ZHENGJIUZHE-REN7000P-28APR:~$ chemprop_predict --test_path data/tox21.csv --checkpoint_dir tox21_checkpoints --preds_path tox21_preds.csv
WARNING:root:No normalization for BCUT2D_MWHI
WARNING:root:No normalization for BCUT2D_MWLOW
WARNING:root:No normalization for BCUT2D_CHGHI
WARNING:root:No normalization for BCUT2D_CHGLO
WARNING:root:No normalization for BCUT2D_LOGPHI
WARNING:root:No normalization for BCUT2D_LOGPLOW
WARNING:root:No normalization for BCUT2D_MRHI
WARNING:root:No normalization for BCUT2D_MRLOW
/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/tap/tap.py:312: UserWarning: add_arguments is deprecated and will be removed on January 1st, 2021 please override "configure" instead and call add_argument there.
warn('add_arguments is deprecated and will be removed on January 1st, 2021'
Loading training args
Loading data
7831it [00:00, 312514.58it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7831/7831 [00:00<00:00, 815290.16it/s]
Validating SMILES
[13:18:10] WARNING: not removing hydrogen atom without neighbors
Test size = 7,831
Predicting with an ensemble of 1 models
0%| | 0/1 [00:00<?, ?it/s]Loading pretrained parameter "encoder.encoder.0.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.0.W_i.weight".
Loading pretrained parameter "encoder.encoder.0.W_h.weight".
Loading pretrained parameter "encoder.encoder.0.W_o.weight".
Loading pretrained parameter "encoder.encoder.0.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
Moving model to cuda
[13:18:12] WARNING: not removing hydrogen atom without neighbors | 0/157 [00:00<?, ?it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:03<00:00, 3.46s/it]
Saving predictions to tox21_preds.csv
Elapsed time = 0:00:04

finally, I want to interpret the results, but I meet error!

(chemprop) mito@mito-ZHENGJIUZHE-REN7000P-28APR:~$ chemprop_interpret --data_path data/tox21.csv --checkpoint_dir tox21_checkpoints/fold_0/ --property_id 1
WARNING:root:No normalization for BCUT2D_MWHI
WARNING:root:No normalization for BCUT2D_MWLOW
WARNING:root:No normalization for BCUT2D_CHGHI
WARNING:root:No normalization for BCUT2D_CHGLO
WARNING:root:No normalization for BCUT2D_LOGPHI
WARNING:root:No normalization for BCUT2D_LOGPLOW
WARNING:root:No normalization for BCUT2D_MRHI
WARNING:root:No normalization for BCUT2D_MRLOW
/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/tap/tap.py:312: UserWarning: add_arguments is deprecated and will be removed on January 1st, 2021 please override "configure" instead and call add_argument there.
warn('add_arguments is deprecated and will be removed on January 1st, 2021'
Loading pretrained parameter "encoder.encoder.0.cached_zero_vector".
Loading pretrained parameter "encoder.encoder.0.W_i.weight".
Loading pretrained parameter "encoder.encoder.0.W_h.weight".
Loading pretrained parameter "encoder.encoder.0.W_o.weight".
Loading pretrained parameter "encoder.encoder.0.W_o.bias".
Loading pretrained parameter "ffn.1.weight".
Loading pretrained parameter "ffn.1.bias".
Loading pretrained parameter "ffn.4.weight".
Loading pretrained parameter "ffn.4.bias".
Moving model to cuda
smiles,NR-AR,rationale,rationale_score
['CCOc1ccc2nc(S(N)(=O)=O)sc2c1'],0.026,,
['CCN1C(=O)NC(c2ccccc2)C1=O'],0.021,,
Traceback (most recent call last):
File "/home/mito/miniconda3/envs/chemprop/bin/chemprop_interpret", line 8, in
sys.exit(chemprop_interpret())
File "/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/chemprop/interpret.py", line 335, in chemprop_interpret
interpret(args=InterpretArgs().parse_args())
File "/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/chemprop/utils.py", line 402, in wrap
result = func(*args, **kwargs)
File "/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/chemprop/interpret.py", line 311, in interpret
rationales = mcts(
File "/home/mito/miniconda3/envs/chemprop/lib/python3.8/site-packages/chemprop/interpret.py", line 263, in mcts
mol = Chem.MolFromSmiles(smiles)
TypeError: No registered converter was able to produce a C++ rvalue of type std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > from this Python object of type list

so what's the problem? and how can I use the interpret function successfully? Look forward to your reply! Thanks!

@hesther
Copy link
Contributor

hesther commented Jan 14, 2021

Thanks for providing all the output, this is very helpful in spotting all the issues here. First, some questions:

  1. Did you download the newest chemprop version for your new test run?
  2. How did you install chemprop (options: from source code via downloading from GitHub and pip install -e . or from pypi via pip install chemprop?

To your training/predicting/interpreting results:

  1. Your training runs fine. The warnings come from third-party software (descriptastorus, tap and rdkit) for which we have no control, but they do not influence your results. The AUC is not printed due to a error in the logging function that we recently fixed - this is why I was asking about how you installed Chemprop, as soon as I know I can help you to fix it. This influences what is printed to terminal, but your checkpoint file still works. And the scores are calculated, you can find them in tox21_checkpoints/test_scores.csv
  2. Your prediction runs fine. The AUC again is not printed to screen due to this same recent logging error.
  3. In interpret.py, there unfortunately is an error that was introduced when we enabled Chemprop to run on multiple molecules in summer. It was already reported (issue 107) and will be fixed in the near future. If you need to use this ASAP, and have installed Chemprop from source, I can show you a hack to fix it for your copy of Chemprop (it is just changing one line of code).

@hesther hesther linked a pull request Jan 14, 2021 that will close this issue
@hmmm7
Copy link
Author

hmmm7 commented Jan 15, 2021

Thanks for providing all the output, this is very helpful in spotting all the issues here. First, some questions:

  1. Did you download the newest chemprop version for your new test run?
  2. How did you install chemprop (options: from source code via downloading from GitHub and pip install -e . or from pypi via pip install chemprop?

To your training/predicting/interpreting results:

  1. Your training runs fine. The warnings come from third-party software (descriptastorus, tap and rdkit) for which we have no control, but they do not influence your results. The AUC is not printed due to a error in the logging function that we recently fixed - this is why I was asking about how you installed Chemprop, as soon as I know I can help you to fix it. This influences what is printed to terminal, but your checkpoint file still works. And the scores are calculated, you can find them in tox21_checkpoints/test_scores.csv
  2. Your prediction runs fine. The AUC again is not printed to screen due to this same recent logging error.
  3. In interpret.py, there unfortunately is an error that was introduced when we enabled Chemprop to run on multiple molecules in summer. It was already reported (issue 107) and will be fixed in the near future. If you need to use this ASAP, and have installed Chemprop from source, I can show you a hack to fix it for your copy of Chemprop (it is just changing one line of code).

dear hesther , I think I should download the newest version of chemprop . and I download by pypi. after download miniconda and pytorch1.7.1(the cuda version is 9.2), I just download chemprop :

conda create -n chemprop python=3.8
conda activate chemprop
conda install -c conda-forge rdkit
pip install git+https://github.com/bp-kelley/descriptastorus
pip install chemprop

@hesther
Copy link
Contributor

hesther commented Jan 15, 2021

The latest PyPI version doesn't have all the newest updates yet (the issue with logging). I also corrected the problem in interpret.py yesterday. A new PyPI version will we released by end of January. If you can wait for it, it will fix your problems! If you don't want to wait, please install via source (it is just as easy to install!)

@kevingreenman
Copy link
Member

I think the descriptastorus warnings should no longer appear if using python>=3.8, given the conditional dependency we introduced in setup.py with #431 and the recent update from the descriptastorus package maintainer.

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

Successfully merging a pull request may close this issue.

4 participants