0

Yesterday I sucessfully loaded the IMDB dataset to my jupyter notebook, with the following code:

from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from tensorflow import keras
import numpy as np

# save np.load
np_load_old = np.load

# modify the default parameters of np.load
np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k)

imdb = keras.datasets.imdb

(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)

# restore np.load for future normal usage
np.load = np_load_old

Now he gives me the error:

TypeError: <lambda>() got multiple values for keyword argument 'allow_pickle'

What do I am missing here?

I am also following this thread.

Bando
  • 1,223
  • 1
  • 12
  • 31
PV8
  • 5,799
  • 7
  • 43
  • 87
  • When I restart the kernel it works, why I cannot run this command twice in the same kernel? – PV8 Aug 13 '19 at 09:05

1 Answers1

0

You can clear all local variable by stopping the kernel "Restart Runtime". It will clear any previously assigned value to "allow_pickle" and solve this problem.