title: How to predict a single input(external) image for categorical data using CNN using Keras
body: <p>I am making a project on handwritten digit recognition using MNIST database and I have trained it for 60,0000 images in the data set  and tested it for the 10,000 test images and got results about 99% accurate. 
  Now I want to input an external image to see whether my handwritten digit is recognized by the CNN or not. So I scanned my own handwritten image, converted it into gray scale and numpy array and feed it into the CNN, but I am always getting the output predicted result as 8 as a one hot encoded vector of numpy array. </p>
  
  <pre><code>              import numpy as np
  
                from keras.preprocessing import image
                test_image = image.load_img('six.jpg', target_size = (28,28))
  
                test_image = image.img_to_array(test_image, data_format = None)
                from numpy import *
                test_image= delete(test_image,  np.s_[::2], 2)
  
  
                test_image = np.expand_dims(test_image, axis = 0)
                predicted_dig = digit_recogniser.predict(test_image,batch_size= 32)
                predicted_digits = np.argmax(np.round(predicted_digits),axis=0)
  </code></pre>
  
  <p>Can you please help me in figuring out what is the problem with the code and how can I successfully predict the digits individually scanned by/ external inputs? My CNN is fully trained using the MNIST data set. This is a kind of single prediction I want to make with some accuracy on taking random handwritten images of my choice.</p>