martin-gorner / tensorflow-rnn-shakespeare

Code from the "Tensorflow and deep learning - without a PhD, Part 2" session on Recurrent Neural Networks.
Apache License 2.0
534 stars 249 forks source link

Get a unicode error. #32

Closed shahzeb1 closed 6 years ago

shahzeb1 commented 6 years ago

After cloning the repo and running python3 rnn_train.py I get the following error:

Traceback (most recent call last):
  File "rnn_train.py", line 148, in <module>
    txt.print_learning_learned_comparison(x, y, l, bookranges, bl, acc, epoch_size, step, epoch)
  File "/global/project/projectdirs/m1532/rafael/note_generator/my_txtutils.py", line 159, in print_learning_learned_comparison
    print(print_string.format(decx, decy, loss_string))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2502' in position 28: ordinal not in range(128)

I am using tensorflow version 1.8.

martin-gorner commented 6 years ago

I have the impression you did more to the code than just cloning and running it ? Right ? The "note_generator" in the file path seems to indicate that you changed the dataset. Can you confirm ? There are a couple of char coding/decoding functions in my_txtutils that might need adjusting with a new dataset.