-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pickle.load(mnist_pickle) returns UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128) #241
Comments
additional info: mnist.pkl.gz is not available in the original location, so I downloaded it from I assume the data is structured differently in this file. |
I see couple of ways of fixing issue:
print(MNIST[0][0][0][130:180]) |
i fixed the 'ascii' code error by specifying the encoding parameter: MNIST = pickle.load(mnist_pickle, encoding='latin1') link to the commit: cutePanda123@a73db3c |
It works , Thank you very much. |
Add another url to download mnist.pkl.gz. All the infos are from microsoft#241
lessons\3-NeuralNetworks\03-Perceptron
running MNIST = pickle.load(mnist_pickle)
results in
5 with gzip.open('../03-Perceptron/mnist.pkl.gz', 'rb') as mnist_pickle:
6
----> 7 MNIST = pickle.load(mnist_pickle)
8
UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128)
Workaround, which creates future problems:
MNIST = pickle.load(mnist_pickle, encoding="latin1") works well, however, the next step to plot the dataset would result in
**TypeError Traceback (most recent call last)
C:\Users\IGOR~1.KOR\AppData\Local\Temp/ipykernel_32352/2720090614.py in
----> 1 print(MNIST['Train']['Features'][0][130:180])
2 print(MNIST['Train']['Labels'][0])
3 features = MNIST['Train']['Features'].astype(np.float32) / 256.0
4 labels = MNIST['Train']['Labels']
5 fig = pylab.figure(figsize=(10,5))
TypeError: tuple indices must be integers or slices, not str**
The text was updated successfully, but these errors were encountered: