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

gen_latent.py: smile code not found #57

Open
chaitanyadwivedii opened this issue May 21, 2020 · 1 comment
Open

gen_latent.py: smile code not found #57

chaitanyadwivedii opened this issue May 21, 2020 · 1 comment

Comments

@chaitanyadwivedii
Copy link

While generating latent representations for BO, there are a few molecules that are perhaps not in the vocabulary, I get the following error:
File "gen_latent.py", line 84, in <module> mol_vec = model.encode_latent_mean(batch) File "JT-VAE/icml18-jtnn/jtnn/jtnn_vae.py", line 61, in encode_latent_mean _, tree_vec, mol_vec = self.encode(mol_batch) File "JT-VAE/icml18-jtnn/jtnn/jtnn_vae.py", line 48, in encode set_batch_nodeID(mol_batch, self.vocab) File "JT-VAE/icml18-jtnn/jtnn/jtnn_vae.py", line 22, in set_batch_nodeID node.wid = vocab.get_index(node.smiles) File "JT-VAE/icml18-jtnn/jtnn/mol_tree.py", line 18, in get_index return self.vmap[smiles] KeyError: 'C1=CN=NC=C1'

@jenna1701
Copy link

I fixed this by adding the missing key to the vocab whenever this error comes up.

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

2 participants