TensorFlow: input shape is incompatible
- TensorFlow
- Keras
You may see
Why it happens
- The picture isn't the size used in training.
- The batch dimension is missing.
- Pixels weren't scaled the same way.
How to fix it
- Resize to the training size.
- Add a batch:
np.expand_dims(img, 0). - Scale exactly as in training (for example divide by 255).
It worked if: model.predict gives numbers.
Related errors
From the official documentation. Keras' usual wording; TensorFlow isn't installed here, so it was not reproduced. Sources: Keras documentation.
Didn't help? Search another error or ask us.

