I have trained my own dataset of images (traffic light images 11x27) with LeNet, using caffe and DIGITS interface. I get 99% accuracy and when I give new images via DIGITS, it predicts the good label, so the network seems to work very well.
However, I struggle to predict the labels through Python/Matlab API for caffe. The last layer output (ip2) is a vector with 2 elements (I have 2 classes), which looks like [4.8060, -5.2608] for example (the first component is always positive, the second always negative and the absolute values range from 4 to 20). I know it from many tests in Python, Matlab and DIGITS.
My problem is :
- Argmax can't work directly on this layer (it always gives 0)
- If I use a softmax function, it will always give me [1, 0] (and that's actually the value of
net.blobs['prob']
orout['prob']
in the python interface, no matter the class of my image)
So, how can I get the good label predicted ?
Thanks!