事前に構築されたカフェ モデルの第 6 層の出力を取得し、その上で SVM をトレーニングしたいと考えています。私の意図は、ユーザーがカスタム画像クラスを作成し、imagenet クラスの代わりにそれらのクラス間で入力画像を分類できるカスタム画像分類器を構築することです。擬似コードは次のとおりです。
#input
file='cat.jpg'
image=caffe.io.load_image(file)
#model
net = caffe.Classifier('deploy.prototxt','model.caffemodel')
#compute activation at layer 6 --- Need help here. Will net.forward help? will the activation be retained?
#extract features from layer 6:
features = net.blobs['fc6'].data[4][:,0, 0]
#SVM
category=svm.predict(features)
print get_category_name(category)