DeepLearningPython: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128)
python 3.6.5 Anaconda still gives this error for
f = gzip.open('mnist.pkl.gz', 'rb')
training_data, validation_data, test_data = pickle.load(f, encoding="latin1")
f.close()
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 22
- Comments: 23
Turns out that un-pickling in Python 3 needs some decoding. As explained here. Basically, after opening on gzip, try the following,
u = pickle._Unpickler( f )
u.encoding = 'latin1'
train, val, test = u.load()
Try from this repo
if you are working on notebook, please shutdown the project and reconnect and then run the code to see. It works for me after such refresh.
In python 3.9 you have to use named parameters like so:
The code provided by @ppatel26 is functional in Python 3.8.2.
Works! Thank you 😃 @shashankravi96