Hi Guys, I am being very unsuccessful in trying to implement a validation test with Oversampling enabled. I had a look at the caffe.Classifier class and some examples which seem to point to it being able to be initialised correctly. It then fails straight after the initialization step with :-
I0223 15:24:52.030282 24764 net.cpp:286] Network initialization done.
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib/python2.7/dist-packages/caffe/classifier.py", line 29, in __init__
in_ = self.inputs[0]
IndexError: list index out of range
I know this has something to do with me missing something out in interfacing with the classifier class, The code below uses a batch size of 1 in order for the classifier to oversample individually for each image and validate the accuracy
import caffe
import numpy
caffe.set_mode_gpu()
net = caffe.Classifier("/home/seamus/Downloads/BVLC_GoogLeNet/train_val.prototxt",
"/home/seamus/Downloads/BVLC_GoogLeNet/snapshot_iter_67.caffemodel",
image_dims=(256, 256))
#Declaring accuracy variable and IterationTest - This defines how many forward passes the network #should be ran through
accuracy = 0
IterationTest=50000
#Loop for running specified number of forward passes
for i in range(IterationTest):
# one iteration
outputs = net.predict()
accuracy+=net.blobs['accuracy-top5'].data
print outputs
#Prints average accuracy over specified number of passes through the network
print('========================================================================')
avgAcc=accuracy/IterationTest
print 'accuracy = ', avgAcc
Please someone help, I'm totally lost here
Thanks
Seamus