I have checked all the solutions, but still, I am facing the same error. My training images shape is (26721, 32, 32, 1)
, which I believe it is 4 dimension, but I don't know why error shows it is 5 dimension.
model = Sequential()
model.add(Convolution2D(16, 5, 5, border_mode='same', input_shape= input_shape ))
So this is how I am defining model.fit_generator
model.fit_generator(train_dataset, train_labels, nb_epoch=epochs, verbose=1,validation_data=(valid_dataset, valid_labels), nb_val_samples=valid_dataset.shape[0],callbacks=model_callbacks)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…