ayumiymk / aster.pytorch

ASTER in Pytorch
MIT License
670 stars 169 forks source link

RuntimeError: "index_select_out_cuda_impl" not implemented for 'Float' #84

Closed Wanna2Sea closed 2 years ago

Wanna2Sea commented 2 years ago

Traceback (most recent call last): File "./demo.py", line 132, in main(args) File "./demo.py", line 123, in main output_dict = model(input_dict) File "/home/hai/miniconda3/envs/recognition/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, kwargs) File "/home/hai/miniconda3/envs/recognition/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward return self.module(*inputs[0], *kwargs[0]) File "/home/hai/miniconda3/envs/recognition/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/hai/code/aster.pytorch/lib/models/model_builder.py", line 92, in forward rec_pred, rec_pred_scores = self.decoder.beam_search(encoder_feats, global_args.beam_width, self.eos) File "/home/hai/code/aster.pytorch/lib/models/attention_recognition_head.py", line 115, in beam_search state = torch.index_select(state, 1, predecessors.squeeze()) RuntimeError: "index_select_out_cuda_impl" not implemented for 'Float' please help me,thanks!

Imalne commented 2 years ago

Did you fix this problem? I met the same errors but I didn't know how to fix it.

Zrufy commented 2 years ago

in file attention_recognition_head.py modify line 111 with

predecessors = (candidates // self.num_classes + pos_index.expand_as(candidates)).view(batch_size * beam_width, 1)