First of all thanks a lot for the great repository.
I'm having a problem in the evaluation script in the batched seq2seq tutorial.
This line results in the variable ni to have a tensor output instead of a word index:
# Choose top word from output
topv, topi = decoder_output.data.topk(1)
ni = topi[0][0]
This is the error I get when I call evaulate function:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-83-b00ef544095f> in <module>()
1 #evaluate_and_show_attention("my")
----> 2 output_words, attentions = evaluate("hey")
3 #input_lang.word2index["hey"]
<ipython-input-82-bdd5eb3ce23d> in evaluate(input_seq, max_length)
40 break
41 else:
---> 42 decoded_words.append(output_lang.index2word[ni])
43
44 # Next input is chosen word
KeyError: tensor(1582)
Hi,
First of all thanks a lot for the great repository. I'm having a problem in the evaluation script in the batched seq2seq tutorial. This line results in the variable
ni
to have a tensor output instead of a word index:This is the error I get when I call evaulate function: