title: Input 0 is incompatible with layer functional_3: expected shape=(None, 224, 224, 3), found shape=(None, 240, 240, 3)
body: <p>I am new to VGG19 and image processing in python. I am trying to test my trained VGG19 model for predicting an image. I am getting this error:-</p>
  <pre><code>ValueError: Input 0 is incompatible with layer functional_3: expected shape=(None, 224, 224, 3), found shape=(None, 240, 240, 3)
  </code></pre>
  <p>My tensorflow code for predicting is:-</p>
  <pre><code>import os
  os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
  import numpy as np
  import cv2
  import tensorflow as tf
  from tensorflow.keras.models import load_model
  model = load_model('VGG19.h5')
  CATEGORIES = [&quot;Pneumonia&quot;, &quot;Non-Pneumonia&quot;]
  img = cv2.imread('person1_bacteria_1.jpeg')
  img = cv2.resize(img,(240,240))     # resize image to match model's expected sizing
  img = np.reshape(img,[1,240,240,3]) # return the image with shaping that TF wants.
  prediction = model.predict(img)
  prediction
  </code></pre>
  <p>But in the case of .ipynb file I simply get a warning regarding this:-</p>
  <p><a href="https://i.stack.imgur.com/6aZ4Y.png" rel="noreferrer">This the image</a></p>