tf_chatbot_seq2seq_antilm
tf_chatbot_seq2seq_antilm copied to clipboard
Error on test mode: seq2seq_model_utils.py
I've found this error occured when trying to test with data set is a part of the training data which has been done.
File /chatbot_seq2seq_antilm/lib/seq2seq_model_utils.py", line 49, in dict_lookup word = rev_vocab[out] if (out < len(rev_vocab)) else data_utils._UNK TypeError: only integer scalar arrays can be converted to a scalar index
Do you have any suggestions ? Thanks for your great works, Regards, JP.Page
This is my command to run: python main.py --mode test --model_name my_modelname --vocab_size 600000 --size 128 --beam_size 5 --antilm 0.7
I've found the problem when i enable the antilm that error will occurs Do anyone have any suggestions?
I found this problem, too.
And I solve it by add out = out[0]
before word = rev_vocab[out] if (out < len(rev_vocab)) else data_utils._UNK
in seq2seq_model_utils.py
therefore, the function dict_lookup()
:
def dict_lookup(rev_vocab, out):
out = out[0] ## deal bug
word = rev_vocab[out] if (out < len(rev_vocab)) else data_utils._UNK
if isinstance(word, bytes):
word = word.decode()
return word
But I haven't tried if I don't use --antilm
setting, this modify would be correct or not.