sherjilozair / char-rnn-tensorflow

Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
MIT License
2.64k stars 964 forks source link

KeyError in Sample.py #127

Open lucav31 opened 6 years ago

lucav31 commented 6 years ago

I used the program all the day and it worked great but with my last experiment I got the following error message:

Traceback (most recent call last): File "sample.py", line 46, in main() File "sample.py", line 27, in main sample(args) File "sample.py", line 43, in sample args.sample).encode('utf-8')) File "C:\Daten\Programmierung\Python\JokeGenerator\char-rnn-tensorflow-master\char-rnn-tensorflow-master\model.py", line 106, in sample x[0, 0] = vocab[char] KeyError: ' '

Seems like anything is wrong with the arguments, but I haven't changed anything. BTW, really nice program & fun to use. Thank you.

santoshchanveer commented 6 years ago

python sample.py --prime (your input )

  1. dont use double quotes for input word
  2. if you are using anaconda prompt then--- goto console properties and enable the use lagacy console option