# Same input size but cannot fit the model in keras

I am trying to fit this model in keras but getting this error :

 Namespace(batch_size=32, epoch=10, num_classes=2)
Start
<class 'numpy.uint8'>
<class 'numpy.ndarray'>
Traceback (most recent call last):
File "main.py", line 67, in <module>
validation_data=(x_val, Y_valHot)
File "/tools/anaconda3/envs/py35/lib/python3.5/site-packages/keras/engine/training.py", line 1581, in fit
batch_size=batch_size)
File "/tools/anaconda3/envs/py35/lib/python3.5/site-packages/keras/engine/training.py", line 1414, in _standardize_user_data
exception_prefix='input')
File "/tools/anaconda3/envs/py35/lib/python3.5/site-packages/keras/engine/training.py", line 153, in _standardize_input_data
str(array.shape))
ValueError: Error when checking input: expected data to have shape (None, 224, 224, 3) but got array with shape (9730, 244, 224, 3)


The function used to fit the model is

model.fit(X_train, Y_train,
batch_size=batch_size,
nb_epoch=nb_epoch,
shuffle=True,
verbose=1,
validation_data=(X_valid, Y_valid),
)


Can someone tell me where I went wrong.

• Please provide a model summary as well as some info about input and output data. – Alessandro Jul 3 '18 at 11:59
• It's the densenet model, I'm trying to fine tune. – Srihari Jul 3 '18 at 13:31

ValueError: Error when checking input: expected data to have shape (None, 224, 224, 3) but got array with shape (9730, 244, 224, 3) it clearly says that while preprocessing that either X_train or X_valid have (9730, **244**, 224, 3) instead of (9730, **224**, 224, 3)