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

Issue about translate #3

Closed
yrq3027 opened this issue Jan 5, 2023 · 2 comments
Closed

Issue about translate #3

yrq3027 opened this issue Jan 5, 2023 · 2 comments

Comments

@yrq3027
Copy link

yrq3027 commented Jan 5, 2023

Hi, after training, I run the translate.py to generate SMILES with followed instruction, However I met some bug. Can you give me some solutions?
python translate.py -condition_dim 768 -use_graph_embedding -arch after_encoding -with_3d_confomer -model /data/u1/projects/mget_3d/experiments/data40_tue/3d_gcn/models/model_step_9500.pt -gpu 0 -src data40_tue_3d/src-test.txt -cond data40_tue_3d/cond-test.txt -output /data/u1/projects/mget_3d/summary_tue/data40/after/9500/pred.txt -beam_size 10 -n_best 10 -batch_size 16 -replace_unk -max_length 200 -fast -use_protein40

Traceback (most recent call last):
File "translate.py", line 100, in
main(opt)
File "translate.py", line 72, in main
opt = opt)
File "/home/data/aidd/deepHops/deephop/onmt/translate/translator.py", line 257, in translate
batch_data = self.translate_batch(batch, data, fast=self.fast)
File "/home/data/aidd/deepHops/deephop/onmt/translate/translator.py", line 441, in translate_batch
return_attention=self.replace_unk)
File "/home/data/aidd/deepHops/deephop/onmt/translate/translator.py", line 581, in _fast_translate_batch
[alive_seq.index_select(0, select_indices),
RuntimeError: expected scalar type Long but found Float
[INFO/MainProcess] process shutting down
[DEBUG/MainProcess] running all "atexit" finalizers with priority >= 0
[DEBUG/MainProcess] running the remaining "atexit" finalizers

@yrq3027 yrq3027 closed this as completed Jan 9, 2023
@spacewalk012
Copy link

Hey @yrq3027, I tried using topk_ids.div(vocab_size).floor().long() but the model output is inconsistent with the results mentioned in the paper. How did you resolve it?

@yrq3027
Copy link
Author

yrq3027 commented Jul 5, 2024

emmm, I can't remember exactly. Recently I did not working on small molecule

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