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 960 forks source link

Open pickled files in binary mode #43

Closed mothepro closed 7 years ago

mothepro commented 8 years ago

Originally parameters were saved in binary mode, this means that they must be opened in binary mode as well.


When attempting to continue training where left of you would receive this error

loading preprocessed files
Traceback (most recent call last):
  File "train.py", line 113, in <module>
    main()
  File "train.py", line 48, in main
    train(args)
  File "train.py", line 75, in train
    saved_chars, saved_vocab = cPickle.load(f)
  File "/usr/lib/python3.4/codecs.py", line 313, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid

Source

Everything looks good in the sample.py though :smile:

hunkim commented 8 years ago

Nice catch!

MingStar commented 8 years ago

+1, got the same error.

codeman38 commented 7 years ago

*facepalm* Argh, I just created a separate merge request for this because I didn't realize this one still existed. Closing mine now.

sherjilozair commented 7 years ago

Whoops. I'm sorry I'm not being able to find much time for this repository.