I'm trying to use a python script to extract a feature value using a pre-trained network. Here's my script:
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import caffe
caffe.set_device(0)
caffe.set_mode_gpu()
net=caffe.Net('blobs-Test-Eval.prototxt', 'best_snapshot_iter_4553.caffemodel', caffe.TEST)
im=np.array(Image.open('Test/D_4051.png'))
im_input = im[np.newaxis, np.newaxis, :, :]
net.blobs['data'].reshape(*im_input.shape)
net.blobs['data'].data[...]=im_input
out=net.forward()
print out['fc8']
Now the image D_4051 should return a score somewhere between 0.002 - 0.006, but the python script returns [[ 2.99469399]] for ANY image from my test set. It's clear my code isn't doing what I want it to do, but from the documentation and examples I have found, I'm unsure what is wrong.
Thanks!