rakeshvar / rnn_ctc

Recurrent Neural Network and Long Short Term Memory (LSTM) with Connectionist Temporal Classification implemented in Theano. Includes a Toy training example.
Apache License 2.0
220 stars 80 forks source link

UnicodeEncodeError: 'latin-1' codec can't encode character '\u2588' in position 0: ordinal not in range(256) #13

Closed w1d2s closed 8 years ago

w1d2s commented 8 years ago

Hello, I ran 'python3 gen_data.py data.pkl' and had error messages as follow:

(0, 1, 2)  !"
 0¦              Traceback (most recent call last):
  File "gen_data.py", line 27, in <module>
    utils.slab_print(x)
  File "/home/speech/wudan14/rnn_ctc-master/utils.py", line 20, in slab_print
    elif val <= 1.:  print('\u2588', end=''),
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2588' in position 0: ordinal not in range(256)

how can i solve this problem?

rakeshvar commented 8 years ago

Set the following environmental variables. This will enable you to print unicode to terminal.

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

You can add the above three lines to your .bashrc file.