ValueError: Object arrays cannot be loaded when allow_pickle=False
Opened this issue · 0 comments
using the google sketch_rnn algorithm, i wanted to use its trained dataset to develop an AI that self draws, but when i used the code below it returned an error.
・OS Platform and Distribution (windows):
・TensorFlow Version: 2.9.1
・Keras Version: 2.9.0
ValueError Traceback (most recent call last)
Input In [16], in <cell line: 2>()
1 val = np.load("C:~/cat//datasets//cat.npz", allow_pickle=True)
----> 2 [train_set, valid_set, test_set, hps_model] = load_dataset(data_dir, model_params)
File ~\cat[http://utils.py:76](https://t.co/zEUaObBCTE), in load_dataset(data_dir, model_params)
73 else:
74 data = np.load(data_filepath)
75 print('Loaded {}/{}/{} from {}'.format(
---> 76 len(data['train']), len(data['valid']), len(data['test']),
77 dataset))
79 if train_strokes is None:
80 train_strokes = data['train']
File ~\Python\Python310\lib\site-packages\numpy\lib[http://npyio.py:245](https://t.co/hcdJ4S5bjN), in NpzFile.getitem(self, key)
243 if magic == format.MAGIC_PREFIX:
244 bytes = http://self.zip.open(key)
--> 245 return http://format.read_array(bytes,
246 allow_pickle=self.allow_pickle,
247 pickle_kwargs=self.pickle_kwargs)
248 else:
249 return http://self.zip.read(key)
File ~\Python\Python310\lib\site-packages\numpy\lib[http://format.py:741](https://t.co/wObyalhE80), in read_array(fp, allow_pickle, pickle_kwargs)
738 if dtype.hasobject:
739 # The array contained Python objects. We need to unpickle the data.
740 if not allow_pickle:
--> 741 raise ValueError("Object arrays cannot be loaded when "
742 "allow_pickle=False")
743 if pickle_kwargs is None:
744 pickle_kwargs = {}
ValueError: Object arrays cannot be loaded when allow_pickle=False