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

Interpret.py error using tox21 data #107

Closed
domgurvic opened this issue Nov 4, 2020 · 1 comment · Fixed by #128
Closed

Interpret.py error using tox21 data #107

domgurvic opened this issue Nov 4, 2020 · 1 comment · Fixed by #128

Comments

@domgurvic
Copy link

Using provided tox21 data and examples in the README:

Command:

python interpret.py --data_path data/tox21.csv --checkpoint_dir tox21_checkpoints --property_id 1 --features_generator rdkit_2d_
normalized --no_features_scaling

Error:

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.023,,
['CCN1C(=O)NC(c2ccccc2)C1=O'],0.030,,
Traceback (most recent call last):
File "interpret.py", line 7, in
chemprop_interpret()
File "/cluster/uz_lab/dgurvic/chemprop_latest/chemprop/interpret.py", line 335, in chemprop_interpret
interpret(args=InterpretArgs().parse_args())
File "/cluster/uz_lab/dgurvic/chemprop_latest/chemprop/utils.py", line 402, in wrap
result = func(*args, **kwargs)
File "/cluster/uz_lab/dgurvic/chemprop_latest/chemprop/interpret.py", line 316, in interpret
prop_delta=args.prop_delta
File "/cluster/uz_lab/dgurvic/chemprop_latest/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

It looks like MolFromSmiles in mcts function receives list of smiles rather than single smile?

@hesther
Copy link
Contributor

hesther commented Jan 14, 2021

Thanks so much for reporting, and sorry for not getting back to you earlier. We will fix this bug very soon.

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.

2 participants