ValueError: Object arrays cannot be loaded when allow_pickle=False

Hello there,

I am working in my local desktop and I was following the github instructions for the lesson 4, 1st part on IMDB classification when I’ve got an error exception after running this command:

data = TextDataBunch.load(path)

ValueError: Object arrays cannot be loaded when allow_pickle=False

It’s solved. The data I’ve saw was from sample imdb. I missed a couple of steps.

1 Like

It’s solved. I had to replace few lines at the load method(data.py), to support allow_pickle=True:

    train_ids,train_lbls = np.load(cache_path/f'train_ids.npy', allow_pickle=True),    np.load(cache_path/f'train_lbl.npy', allow_pickle=True)
    valid_ids,valid_lbls = np.load(cache_path/f'valid_ids.npy', allow_pickle=True), np.load(cache_path/f'valid_lbl.npy', allow_pickle=True)
    test_ids = np.load(cache_path/f'test_ids.npy', allow_pickle=True) if os.path.isfile(cache_path/f'test_ids.npy') else None