stanford-tensorflow-tutorials
stanford-tensorflow-tutorials copied to clipboard
Lecture 11: 11_char_rnn ... 'charmap' codec can't decode byte 0x81 in position 170 ...
Hi -
I get the below traceback ... can you help with this one, please ?
Kind regards, Jesper.
UnicodeDecodeError Traceback (most recent call last)
~\Anaconda3\lib\encodings\cp1252.py in decode(self, input, final) 21 class IncrementalDecoder(codecs.IncrementalDecoder): 22 def decode(self, input, final=False): ---> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0] 24 25 class StreamWriter(Codec,codecs.StreamWriter):
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 170: character maps to
This is the file encoding issue Change line 27 to: lines = [line.strip() for line in open(filename, 'r', encoding="utf-8").readlines()]
Thank you