How to use VGG-S and how to extract output features by it?
2 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
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?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!