In deep learning there are many model of convolution neural network CNN. To try VGG-S model, I download "imagenet-vgg-s.mat" from here and I try it by this code to extract the output feature from 2nd fully connected layer:
net = load('./Model/imagenet-vgg-s.mat'); layer = net.layers{1,18}.name; outputFeatures = activations(net,Img,layer);
but this error shown:
_ *Undefined function 'activations' for input arguments of type 'struct'. Error in Project (line 31) outputFeatures = activations(net,Img,layer);*_
So I download prototxt and caffe model of it "VGG_CNN_S.caffemodel" and "VGG_CNN_S_deploy.prototxt" from this link here . I try it by this code
protofile = './model/ VGG_CNN_S_deploy.prototxt '; datafile = './model/ VGG_CNN_S.caffemodel '; net = importCaffeNetwork(protofile, datafile);
but this error is shown:
Error using nnet.internal.cnn.caffe.CaffeModelReader/checkIfPoolingLayerOutputSizeMatchesCaffe (line 1081) The pooling layer 'pool1' is not compatible with MATLAB. Caffe computes the output size as [37 37 96] but MATLAB computes it as [36 36 96]. Error in nnet.internal.cnn.caffe.CaffeModelReader/makePoolingLayer (line 928) checkIfPoolingLayerOutputSizeMatchesCaffe(this, inputSize, internalLayer); Error in nnet.internal.cnn.caffe.CaffeModelReader/importLayers (line 257) [layers(layerIdx), internalLayer, outputSize] = makePoolingLayer(this, origLayerIdxInFile, outputSize); Error in nnet.internal.cnn.caffe.CaffeModelReader/importSeriesNetwork (line 310) layers = importLayers(this); Error in importCaffeNetwork (line 82) network = importSeriesNetwork(readerObj);
Could you help me how to use VGG-S and how to extract output features by it?