Does anybody come across this error? It seems to be something wrong with Keras itself and I have not find an executable way to solve it yet. Appreciate for your kind help. The details are as follows.
C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py:86: UserWarning: Update your fit_generator call to the Keras 2 API: fit_generator(<data_prep..., 30000, 1, validation_data=<data_prep..., validation_steps=1000)
'` call to the Keras 2 API: ' + signature)
Epoch 1/1
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\lib\threading.py", line 864, in run
self._target(*self._args, *self._kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 606, in data_generator_task
generator_output = next(self._generator)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\preprocessing\image.py", line 727, in next
return self.next(args, **kwargs)
File "F:\Users\wanfb\Documents\Implementation-CVPR2015-CNN-for-ReID-master\CUHK03\data_preparation.py", line 34, in next
index_array, current_index, current_batch_size = next(self.index_generator)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\preprocessing\image.py", line 718, in _flow_index
yield (index_array[current_index: current_index + current_batch_size],
TypeError: slice indices must be integers or None or have an index method
Traceback (most recent call last):
File "main.py", line 100, in
main(args.dataset_path)
File "main.py", line 20, in main
train(model, dataset_path)
File "main.py", line 43, in train
model.fit_generator(Data_Generator.flow(f,flag = flag_train),one_epoch,epoch_num,validation_data=Data_Generator.flow(f,train_or_validation=which_val_data,flag=flag_val),nb_val_samples=nb_val_samples)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1851, in fit_generator
str(generator_output))
ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None
Does anybody come across this error? It seems to be something wrong with Keras itself and I have not find an executable way to solve it yet. Appreciate for your kind help. The details are as follows.
C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py:86: UserWarning: Update your
fit_generator
call to the Keras 2 API:fit_generator(<data_prep..., 30000, 1, validation_data=<data_prep..., validation_steps=1000)
'` call to the Keras 2 API: ' + signature) Epoch 1/1 Exception in thread Thread-1: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\ProgramData\Anaconda3\lib\threading.py", line 864, in run self._target(*self._args, *self._kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 606, in data_generator_task generator_output = next(self._generator) File "C:\ProgramData\Anaconda3\lib\site-packages\keras\preprocessing\image.py", line 727, in next return self.next(args, **kwargs) File "F:\Users\wanfb\Documents\Implementation-CVPR2015-CNN-for-ReID-master\CUHK03\data_preparation.py", line 34, in next index_array, current_index, current_batch_size = next(self.index_generator) File "C:\ProgramData\Anaconda3\lib\site-packages\keras\preprocessing\image.py", line 718, in _flow_index yield (index_array[current_index: current_index + current_batch_size], TypeError: slice indices must be integers or None or have an index methodTraceback (most recent call last): File "main.py", line 100, in
main(args.dataset_path)
File "main.py", line 20, in main
train(model, dataset_path)
File "main.py", line 43, in train
model.fit_generator(Data_Generator.flow(f,flag = flag_train),one_epoch,epoch_num,validation_data=Data_Generator.flow(f,train_or_validation=which_val_data,flag=flag_val),nb_val_samples=nb_val_samples)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1851, in fit_generator
str(generator_output))
ValueError: output of generator should be a tuple
(x, y, sample_weight)
or(x, y)
. Found: None