fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.17k stars 8.53k forks source link

IMDB Data Read Error #110

Open odundar opened 5 years ago

odundar commented 5 years ago

Reading from imdb data set raises error as:

'charmap' codec can't decode byte 0x8d in position 194

Fix is to open file with utf-8 encoding with adding encoding definition in open.

encoding="utf-8"
dagrimm commented 5 years ago

I got an error using numpy=1.16.3 : keras imdb ValueError: Object arrays cannot be loaded when allow_pickle=False downgrading to numpy=1.16.2 solved the problem

RorisangSitoboli commented 5 years ago

You do not need to explicitly downgrade Numpy. Use the following code to 'allow_pickle':

old = np.load, np.load = lambda *a, **k:old(*a, **k, allow_pickle=TRUE), from keras.datasets import mnist, np.load=old, del(old)

The last line allows Numpy to load normally after you have read in your MNIST data set.