Caffe2 extract fc7 features

94 Views Asked by At

recently, I tried to use Convolutional Neural Network(CNN) to extract features of images. The model I used is alexnet, the framework is Caffe2 with Python 3.6.4.

The problem is that I want to extract features of FC7 layer, which should have a dimension of 4096.

How could I manage this issue?

1

There are 1 best solutions below

0
On BEST ANSWER

You should use the FetchBlob(blob_name) function of workspace. In your case (assuming that the name of the output of FC7 is 'fc7'):

blob = workspace.FetchBlob('fc7')

Now, you can easily print the output shape:

print(blob.shape)