I have trained model.h5 file i want to test my model with test data but i m facing above problems

ValueError: Exception encountered when calling Sequential.call().

Invalid input shape for input Tensor(“data:0”, shape=(5, 224, 224, 3), dtype=float32). Expected shape (None, 512), but input has incompatible shape (5, 224, 224, 3)

Arguments received by Sequential.call():
• inputs=tf.Tensor(shape=(5, 224, 224, 3), dtype=float32)
• training=False
• mask=None


ValueError: Exception encountered when calling Sequential.call().

Input 0 of layer “dense” is incompatible with the layer: expected axis -1 of input shape to have value 512, but received input with shape (5, 25088)

Arguments received by Sequential.call():
• inputs=tf.Tensor(shape=(5, 25088), dtype=float32)
• training=False
• mask=None how can we resolve two error at a time.

Hi @Sanjay_Madupu, The error is due to the shape mismatch between the data that you are feeding to the model and the model input. please make sure that the data shape matches the model input. Thank You.