title: Keras Output Dimensions of VGG19 Conv4-1 Layer doesn't match up with model output
body: <pre><code>import numpy as np
  from PIL import Image
  from keras.preprocessing import image
  from keras.applications.vgg19 import preprocess_input
  </code></pre>
  
  <p>To create the VGG19 model I use:</p>
  
  <pre><code>img = Input(shape=(256,256,3))
  vgg = VGG19(weights="imagenet")
  vgg.outputs = [vgg.get_layer('block4_conv1').output]
  model = Model(inputs=img, outputs=vgg(img))
  </code></pre>
  
  <p>Then in the <code>model.summary()</code> I see that:</p>
  
  <p><code>block4_conv1 (Conv2D)        (None, 28, 28, 512)       1180160</code> </p>
  
  <p>My expected dimensions are <code>(28,28,512)</code>.</p>
  
  <p>To load the image into the network I use:</p>
  
  <pre><code>img = image.load_img("./path-to-image.jpeg", target_size=(256, 256))
  img = preprocess_input(np.array(img))
  </code></pre>
  
  <p>However, when I put my image through the model, my output dimension is <code>(1, 32, 32, 512)</code> and it makes no sense as to why this happens!</p>
  
  <p>To get output dimensions I run:</p>
  
  <pre><code>img_out = \
      model.predict(
          np.expand_dims(img, 0), 
          batch_size=1
      )
  
  img_out.shape
  &gt;&gt;&gt; (1, 32, 32, 512) != (28,28,512)
  </code></pre>