burliEnterprises / tensorflow-shakespeare-poem-generator

generates new poem using a Tensorflow RNN
https://medium.com/@m_ko/deep-learning-with-tensorflow-part-3-music-and-text-generation-370cf37bb071
Apache License 2.0
73 stars 27 forks source link

'charmap' codec can't encode character '\u2502' #1

Open skorotkiewicz opened 6 years ago

skorotkiewicz commented 6 years ago

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 "C:\Users\sebas\tensorflow-shakespeare-poem-generator\my_txtutils.py", line 159, in print_learning_learned_comparison print(print_string.format(decx, decy, loss_string)) File "E:\Programy\Miniconda\envs\tensorflow-python\lib\encodings\cp1250.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2502' in position 44: character maps to <undefined>

jameshulse commented 6 years ago

Are you running the training on a remote machine (ssh)?

I had a similar issue. It worked fine locally but I uploaded the solution to a beefy AWS box and ran in to unicode issues.

To fix the issue I had to comment out the line in my global SSH config which forwards your locale settings from your local machine.

The file is: /etc/ssh/ssh_config and you need to add a # to the start of the SendEnv line like so:

Host *
#       SendEnv LANG LC_*