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

ValueError: need at least one array to concatenate #31

Open
zchwang opened this issue Nov 17, 2023 · 2 comments
Open

ValueError: need at least one array to concatenate #31

zchwang opened this issue Nov 17, 2023 · 2 comments

Comments

@zchwang
Copy link

zchwang commented Nov 17, 2023

Hi,

I encountered the following error while generating molecular embeddings (using "cddd --input smiles.smi --output descriptors.csv --smiles_header smiles") from SMILES input. The occurrence of this error is approximately 20%. Is there any way to avoid this error?

"""
Consider installing the package zmq to utilize the InferenceServer class
start preprocessing SMILES...
finished preprocessing SMILES!
start calculating descriptors...
I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Error: seq2emb
Traceback (most recent call last):
File "/home/wzc/anaconda3/envs/cddd/bin/cddd", line 8, in
sys.exit(main_wrapper())
File "/home/wzc/anaconda3/envs/cddd/lib/python3.6/site-packages/cddd/run_cddd.py", line 99, in main_wrapper
tf.app.run(main=main, argv=[sys.argv[0]] + UNPARSED)
File "/home/wzc/anaconda3/envs/cddd/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/home/wzc/anaconda3/envs/cddd/lib/python3.6/site-packages/cddd/run_cddd.py", line 80, in main
descriptors = infer_model.seq_to_emb(sml_list)
File "/home/wzc/anaconda3/envs/cddd/lib/python3.6/site-packages/cddd/inference.py", line 127, in seq_to_emb
emb = sequence2embedding(self.encode_model, self.hparams, seq)
File "/home/wzc/anaconda3/envs/cddd/lib/python3.6/site-packages/cddd/inference.py", line 46, in sequence2embedding
embedding_array = np.concatenate(emb_list)
ValueError: need at least one array to concatenate
"""

Best regards.

@jrwnter
Copy link
Owner

jrwnter commented Nov 22, 2023

Hi, this looks like the model is not returning a single representation in emb_list. My guess is that either the smiles contain only characters that are ignored by the model or the preprocessing removes all the smiles...
Can you try running this with the "--no-preprocess" flag?

@Jalil-Mahdizadeh
Copy link

Hi,
@jrwnter does using --no-preprocess means no need for rdkit?

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