First off, love the course!
I’ve been having trouble with running .fit or .predict on my model for the State Farm competition. I’m just using the simplest model from the lesson to demonstrate the error, but when I have:
model = Sequential([
I am able to successfully run:
model.compile(Adam(lr=0.0001), loss=‘categorical_crossentropy’, metrics=[‘accuracy’])
model.fit_generator(batches, batches.nb_sample, nb_epoch=1, validation_data=val_batches,
model_train_feat = model.predict_generator(batches, batches.nb_sample)
model_val_feat = model.predict_generator(val_batches, val_batches.nb_sample)
However, when I run:
model.fit(model_train_feat, trn_labels, batch_size=batch_size, nb_epoch=1,
Error when checking model input: expected batchnormalization_input_8 to have 4 dimensions, but got array with shape (1500, 10)
I have run model.summary and first layer is this:
Layer (type) Output Shape Param # Connected to
batchnormalization_28 (BatchNorm (None, 3, 224, 224) 896 batchnormalization_input_8
I don’t understand why it is expecting 4 dimensions, or how to change this. I have spent several hours reading forums and documentation but can’t seem to figure it out. Any advice would be much appreciated!