Skip to content Skip to sidebar Skip to footer

Python Pickle UnicodeDecodeError

I'm trying to load the mnist character dataset (following the tutorial outlined here: http://neuralnetworksanddeeplearning.com/chap1.html ) when I run the load_data_wrapper functio

Solution 1:

As stated the main problem turned out to be incompatibility between python 2.x cPickle and python 3.x pickle.

setting the encoding to 'latin-1' seems to work.

training_data, validation_data, test_data = pickle.load(f, encoding='latin1')

Answer here helped a lot: Pickle incompatability of numpy arrays between Python 2 and 3


Solution 2:

You can try this:

  import chainer  
  train, test = chainer.datasets.get_mnist(ndim=1)

Post a Comment for "Python Pickle UnicodeDecodeError"