Dear Caffe Users,
my (pre-trained) caffe model yields different results depending on whether it is tested via pycaffe or from the terminal.
This is even though both methods use exactly the same model and copy the same weights. Here is how I do the calls:
(1) via pycaffe:
model = '/home/user/caffe/models/modelFolder/network.prototxt'
weights = '/home/user/caffe/
models/modelFolder/pretrainedWeights.caffemodel'
net = caffe.Net(model, weights, caffe.TEST)
outCaffe1 = net.forward()
outCaffe2 = net.forward()
outCaffe3 = net.forward()
(2) via terminal:
caffe test -model /home/user/caffe/models/modelFolder/network.prototxt -weights /home/user/caffe/models/modelFolder/pretrainedWeights.caffemodel -iterations 3
The differences are considerable, for method (1) testing accuracy is at about 0.5 (with a loss of circa 1.2 for batches of 32, this performance is expected!), while for (2) the accuracy is smaller than 0.05 (with a loss of circa 90 for batches of 32). Moreover, in the network.txt's ImageData layer I have set shuffle: false (which is also the default), in order to ensure both methods run on identical data. I can't find an explanation for this. Are the copied weights somehow overwritten in method (2)? How could I check this? Is there any other test I could conduct to find the cause of this difference?
Thank you very much for any insights!