how to test mnist on my own dataset images
Question: I'm trying to test mnist using my own dataset of digits images.  
I wrote a python script for that but it is giving an error. error is in line
no 16 of code. Actually i'm not able to send image for test. give me some
suggestions. thanks in advance.

    
    
    import numpy as np
    import sys
    import caffe
    import matplotlib.pyplot as plt
    import os
    
    caffe_root = '../caffe-master/'
    MODEL_FILE = './examples/mnist/lenet.prototxt'
    PRETRAINED = './examples/mnist/lenet_iter_10000.caffemodel'
    IMAGE_FILE = '/home/hemant/OpenCVProject/grey/img001-00001.png'#image path
    
    input_image = caffe.io.load_image(IMAGE_FILE)
    
    net = caffe.Net(MODEL_FILE, PRETRAINED,caffe.TEST)
    caffe.set_mode_cpu()
    out = net.forward([input_image])
    print out['prob']
    


Answer: Why don't you use the python wrapper class `Classifier`?

    
    
    net = caffe.Classifier( MODEL_FILE, PRETRAINED )
    net.predict( [input_image], oversmaple=False )
    

I'm not 100% sure, but I think LeNeT model expect gray scale image, you might
need to read the image

    
    
    input_image = caffe.io.load_image(IMAGE_FILE, color=False)
    

