Imdb dataset not loading

when i execute this code:
“(X_train,y_train),(X_test,y_test)=imdb.load_data(num_words=10000)”

i get this error:
“Object arrays cannot be loaded when allow_pickle=False”

Hello @S19MLN0060,

import numpy as np
from functools import partial
np.load = partial(np.load, allow_pickle=True)
(X_train,y_train),(X_test,y_test)=imdb.load_data(num_words=10000)

You need to add the above 2 lines before imdb.load_data. Here we just made a wrapper function with parameter allow_pickle set to True, which is by default set to False.

Happy Learning :slight_smile:
Thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.