I am quite new to python and I am looking at an AI code and I need to read a file containing the training data. The code provided for this part looks like this:
import _pickle as cPickle
import gzip
import numpy as np
f = gzip.open('../data/mnist.pkl.gz', 'rb')
training_data, validation_data, test_data = cPickle.load(f)
f.close()
However I get this error:
Traceback (most recent call last):
File "test.py", line 6, in <module>
training_data, validation_data, test_data = cPickle.load(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128)
Can someone tell me why and how to fix it? Or what else should I use to read it? (The code I am using is from a quite reliable source so it should work out of the box...)