Wrong testing results on MNIIST data

20 views
Skip to first unread message

Azam Hamidinekoo

unread,
Jul 27, 2016, 10:23:11 AM7/27/16
to Caffe Users
Hello.
I have trained the LeNet on caffe on Mac. it was trained with 99% accuracy. Now I want to check it with some digits I downloaded from internet. 
I have written the code bellow.  
After executing this code, giving any numbers ( as images) I get [1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] for the score. Which shows something is wrong!!!!!
Could you please tell me what id wrong in testing section? I think the training was done completely!

Regards



--------------------------------- the code for testing)--------------------------------------
import numpy as np
import sys
import matplotlib.pyplot as plt
import os
import sys
caffe_root = '../' # this file should be run from {caffe_root}/examples (otherwise change this line)
sys.path.insert(0, caffe_root + 'python')
import caffe

MODEL_FILE = '/a PATH/caffe-master/examples/mnist/lenet.prototxt'
PRETRAINED = '/a PATH/caffe-master/examples/mnist/lenet_iter_10000.caffemodel'
IMAGE_FILE = '/a PATH/2.png' #image path

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


net = caffe.Classifier(MODEL_FILE, PRETRAINED, image_dims=(28, 28), raw_scale=255)
score = net.predict([input_image], oversample=False)
print score

Reply all
Reply to author
Forward
0 new messages