wangxr0526 / RetroPrime

Code for Single-step Retrosynthesis model Retroprime
MIT License
34 stars 6 forks source link

运行 run_example.sh时,会出现RuntimeError: "index_select_out_cuda_impl" not implemented for 'Float' #8

Open Waterdrop-One opened 2 years ago

Waterdrop-One commented 2 years ago

Products to Synthons 0%| | 0/1 [00:00<?, ?it/s]/home/lzf/software/anaconda3/envs/seq_gr/lib/python3.7/site-packages/torchtext/data/field.py:359: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requiresgrad(True), rather than torch.tensor(sourceTensor). var = torch.tensor(arr, dtype=self.dtype, device=device) /home/lzf/programme/Retroprime/RetroPrime/retroprime/transformer_model/onmt/translate/translator.py:613: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requiresgrad(True), rather than torch.tensor(sourceTensor). return torch.tensor(a, requires_grad=False) 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "retroprime/transformer_model/translate.py", line 53, in main(opt) File "retroprime/transformer_model/translate.py", line 34, in main attn_debug=opt.attn_debug) File "/home/lzf/programme/Retroprime/RetroPrime/retroprime/transformer_model/onmt/translate/translator.py", line 238, in translate batch_data = self.translate_batch(batch, data, fast=self.fast) File "/home/lzf/programme/Retroprime/RetroPrime/retroprime/transformer_model/onmt/translate/translator.py", line 375, in translate_batch return self._translate_batch(batch, data) File "/home/lzf/programme/Retroprime/RetroPrime/retroprime/transformer_model/onmt/translate/translator.py", line 712, in _translate_batch beam_attn.data[:, j, :memory_lengths[j]]) File "/home/lzf/programme/Retroprime/RetroPrime/retroprime/transformer_model/onmt/translate/beam.py", line 140, in advance self.attn.append(attn_out.index_select(0, prev_k)) RuntimeError: "index_select_out_cuda_impl" not implemented for 'Float'

1991806559 commented 1 year ago

请问你这个问题后来解决了吗?

woshi45 commented 11 months ago

This error may be caused by using an unsupported CUDA operation. Possible solutions are to make sure that your version of CUDA is compatible with the version of PyTorch you are using, and to check for other dependencies or configuration issues.