word-rnn-tensorflow icon indicating copy to clipboard operation
word-rnn-tensorflow copied to clipboard

IndexError: list index out of range at pred = words[sample]

Open hunkim opened this issue 9 years ago • 2 comments

Cannot reproduce it anymore, but for the record:

hunkim:~/word-rnn-tensorflow$ python sample.py --prime="kmalloc"
kmalloc
Traceback (most recent call last):
  File "sample.py", line 42, in <module>
    main()
  File "sample.py", line 25, in main
    sample(args)
  File "sample.py", line 39, in sample
    print(model.sample(sess, words, vocab, args.n, args.prime, args.sample))
  File "/home/hunkim/word-rnn-tensorflow/model.py", line 97, in sample
    pred = words[sample]
IndexError: list index out of range

hunkim avatar Oct 17 '16 00:10 hunkim

Could there be something wrong with the format of the lines in the words_vocab.pkl file?like empty lines?

sunxiaobiu avatar Oct 30 '16 16:10 sunxiaobiu

@sunxiaobiu Could you reproduce this error?

hunkim avatar Nov 03 '16 07:11 hunkim