microsoft / CodeXGLUE

CodeXGLUE
MIT License
1.51k stars 363 forks source link

TypeError: tuple indices must be integers or slices, not tuple #64

Closed sdkjksfd closed 3 years ago

sdkjksfd commented 3 years ago

Did you meet the error while running 'python3 -u run_lm.py ....' in 'Code-Code/CodeCompletion-line/code'

The detailed error message shows as following:

Traceback (most recent call last):
  File "run_lm.py", line 626, in <module>
    main()
  File "run_lm.py", line 622, in main
    eval_line_completion(args, model, tokenizer, file_type="test")
  File "run_lm.py", line 355, in eval_line_completion
    past_hidden = [x[:, i:i+1].expand(-1, beam_size, -1, -1, -1) for x in outputs]
  File "run_lm.py", line 355, in <listcomp>
    past_hidden = [x[:, i:i+1].expand(-1, beam_size, -1, -1, -1) for x in outputs]
TypeError: tuple indices must be integers or slices, not tuple

Many thanks.

celbree commented 3 years ago

The same error in #60. You could refer to https://github.com/microsoft/CodeXGLUE/issues/60#issuecomment-855761068