ParlAI icon indicating copy to clipboard operation
ParlAI copied to clipboard

MemNN broken interactive

Open klshuster opened this issue 6 years ago • 1 comments

Bug description The MemNN breaks during interactive, when you use a word that is out of dictionary (for the location).

Reproduction steps Run the following commands from the Quick-Start, then type a location that is not in the dictionary.

$ python examples/train_model.py -t babi:task10k:1 -mf /tmp/babi_memnn -bs 1 -nt 4 -eps 5 -m memnn --no-cuda
$ python examples/interactive.py -mf /tmp/babi_memnn -ecands vocab

Expected behavior We would expect the model to

Logs

$ python examples/train_model.py -t babi:task10k:1 -mf /tmp/babi_memnn -bs 1 -nt 4 -eps 5 -m memnn --no-cuda
...

$ python examples/interactive.py -mf /tmp/babi_memnn -ecands vocab
...
Enter Your Message: Kurt went to the hallway.\n Where is Kurt?
/Users/kshuster/ParlAI/parlai/core/torch_ranker_agent.py:649: UserWarning: [ Executing eval mode with a common set of fixed candidates (n = 9000). ]
  "(n = {}). ]".format(mode, len(self.fixed_candidates))
[Memnn]: hallway
Enter Your Message: Kurt went to the classroom.\n Where is Kurt?
Traceback (most recent call last):
  File "examples/interactive.py", line 18, in <module>
    interactive(opt, print_parser=parser)
  File "/Users/kshuster/ParlAI/parlai/scripts/interactive.py", line 79, in interactive
    world.parley()
  File "/Users/kshuster/ParlAI/parlai/core/worlds.py", line 277, in parley
    acts[1] = agents[1].act()
  File "/Users/kshuster/ParlAI/parlai/core/torch_agent.py", line 1696, in act
    return self.batch_act([self.observation])[0]
  File "/Users/kshuster/ParlAI/parlai/core/torch_agent.py", line 1725, in batch_act
    output = self.eval_step(batch)
  File "/Users/kshuster/ParlAI/parlai/core/torch_ranker_agent.py", line 448, in eval_step
    preds = [cand_preds[i][0] for i in range(batchsize)]
  File "/Users/kshuster/ParlAI/parlai/core/torch_ranker_agent.py", line 448, in <listcomp>
    preds = [cand_preds[i][0] for i in range(batchsize)]
IndexError: list index out of range
kshuster-mbp:ParlAI kshuster$

klshuster avatar Sep 14 '19 16:09 klshuster

This issue has not had activity in 30 days. Marking as stale.

github-actions[bot] avatar Jun 02 '20 00:06 github-actions[bot]

This seems to no longer be an issue

klshuster avatar Nov 09 '22 22:11 klshuster