How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function?

后端 未结 20 2201
花落未央
花落未央 2020-12-04 11:28

I\'m trying to implement the binary classification example using the IMDb dataset in Google Colab. I have implemented this model before. But when I tried to

20条回答
  •  -上瘾入骨i
    2020-12-04 11:50

    on jupyter notebook using

    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)
    

    worked fine, but the problem appears when you use this method in spyder(you have to restart the kernel every time or you will get an error like:

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

    I solved this issue using the solution here:

提交回复
热议问题