Convert MNIST data from numpy arrays to original ubyte data
问题 I used this code almost exactly, just changing the line: f = gzip.open("../data/mnist.pkl.gz", 'rb') training_data, validation_data, test_data = cPickle.load(f) to these lines: import pickle as cPickle f = gzip.open("mnist.pkl.gz", 'rb') u = cPickle._Unpickler(f) u.encoding='latin1' training_data, validation_data, test_data = u.load() to account for pickling issues.The original mnist.pkl.gz was downloaded from his repo (available here), or the code to generate the .pkl.gz is here. The output