title: How do I make predictions on the MNIST dataset with reshaping?
body: <pre><code>I'm working on a simple example of a ANN using the MNIST dataset. I think I understand the basic breakdown of the model, including reshaping the data, but I'm having trouble with the prediction aspect. 
  
  model = keras.Sequential([
      layers.Dense(512, activation='relu'),
      layers.Dense(100, activation='relu'),
      layers.Dense(10, activation='softmax')
  ])
  
  model.compile(optimizer='rmsprop',
               loss='sparse_categorical_crossentropy',
               metrics=[&quot;accuracy&quot;])
  
  train_images = train_images.reshape((60000, 28 * 28))
  train_images = train_images.astype(&quot;float32&quot;) / 255
  test_images = test_images.reshape((10000, 28 * 28))
  test_images = test_images.astype(&quot;float32&quot;) / 255
  
  model.fit(train_images, train_labels, epochs=5, batch_size=128)
  model.predict(test_images)
  
  img = test_images[4].reshape(28, 28)
  plt.imshow(img)
  
  model.predict(test_images[4])
  </code></pre>
  <p>When I predict on &quot;img,&quot;  I get the following error: &quot; ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 784 but received input with shape (None, 1).&quot; However, I reshaped &quot;IMG,&quot; so I'm not sure how to fix the error to test the model's prediction. I also tried model.predict(img). Please advise.</p>