在iterative_refinement_generator.py中运行到word_ins_score, word_ins_pred = word_ins_score.topk(token_beam, dim=-1)时报错:
sys.exit(load_entry_point('fairseq', 'console_scripts', 'fairseq-generate')())
File "/home/top/projects/editretro/fairseq/fairseq_cli/generate.py", line 207, in cli_main
main(args)
File "/home/top/projects/editretro/fairseq/fairseq_cli/generate.py", line 105, in main
hypos = task.inference_step(generator, models, sample, prefix_tokens)
File "/home/top/projects/editretro/fairseq/fairseq/tasks/fairseq_task.py", line 351, in inference_step
return generator.generate(models, sample, prefix_tokens=prefix_tokens)
File "/home/top/anaconda3/envs/editretro/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/top/projects/editretro/editretro/models/iterative_refinement_generator.py", line 305, in generate
decoder_out = model.forward_decoder_token(
File "/home/top/projects/editretro/editretro/models/editretro_nat.py", line 732, in forward_decoder_token
word_ins_score, word_ins_pred = word_ins_score.topk(token_beam, dim=-1)
RuntimeError: CUDA error: an illegal memory access was encountered
在iterative_refinement_generator.py中运行到word_ins_score, word_ins_pred = word_ins_score.topk(token_beam, dim=-1)时报错: sys.exit(load_entry_point('fairseq', 'console_scripts', 'fairseq-generate')()) File "/home/top/projects/editretro/fairseq/fairseq_cli/generate.py", line 207, in cli_main main(args) File "/home/top/projects/editretro/fairseq/fairseq_cli/generate.py", line 105, in main hypos = task.inference_step(generator, models, sample, prefix_tokens) File "/home/top/projects/editretro/fairseq/fairseq/tasks/fairseq_task.py", line 351, in inference_step return generator.generate(models, sample, prefix_tokens=prefix_tokens) File "/home/top/anaconda3/envs/editretro/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "/home/top/projects/editretro/editretro/models/iterative_refinement_generator.py", line 305, in generate decoder_out = model.forward_decoder_token( File "/home/top/projects/editretro/editretro/models/editretro_nat.py", line 732, in forward_decoder_token word_ins_score, word_ins_pred = word_ins_score.topk(token_beam, dim=-1) RuntimeError: CUDA error: an illegal memory access was encountered
word_ins_score的值是: tensor([[[ -8.4584, -8.1290, -7.4481, ..., -8.1291, -8.1291, -8.1291], [-10.1991, -10.8062, -11.1370, ..., -10.8064, -10.8062, -10.8063], [ -9.7229, -10.7866, -10.7560, ..., -10.7868, -10.7867, -10.7868], ..., [ -9.8793, -10.6177, -10.9736, ..., -10.6178, -10.6177, -10.6178], [ -9.8793, -10.6177, -10.9736, ..., -10.6178, -10.6177, -10.6178], [ -9.8793, -10.6177, -10.9736, ..., -10.6178, -10.6177, -10.6178]],