Traceback (most recent call last):
File "train_liveness.py", line 142, in <module>
epochs=EPOCHS)
File "C:\Users\Gepeng-Ji\Anaconda3\envs\keras\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Users\Gepeng-Ji\Anaconda3\envs\keras\lib\site-packages\keras\engine\training.py", line 1418, in fit_generator
initial_epoch=initial_epoch)
File "C:\Users\Gepeng-Ji\Anaconda3\envs\keras\lib\site-packages\keras\engine\training_generator.py", line 144, in fit_generator
val_x, val_y, val_sample_weight)
File "C:\Users\Gepeng-Ji\Anaconda3\envs\keras\lib\site-packages\keras\engine\training.py", line 751, in _standardize_user_data
exception_prefix='input')
File "C:\Users\Gepeng-Ji\Anaconda3\envs\keras\lib\site-packages\keras\engine\training_utils.py", line 128, in standardize_input_data
'with shape ' + str(data_shape))
ValueError: Error when checking input: expected input_2 to have 2 dimensions, but got array with shape (78, 2, 2)
It’s because that labels are one-hot encoded twice. Please try to remove following line:
ImageDataGenerator doesn’t support the tuple ([X_train, y_train], y_train)… Please try following code:
Did you pass the tuple (X_train, y_train) to the generator? That is not right. You must pass the tuple ([X_train, y_train], y_train) to the generator.
Hi! Please paste your train_liveness.py here.