44 Downloads
Updated 11 Sep 2019
This software support package provides functions for importing pretrained models as well as layers of Convolutional Neural Networks (CNNs) from Caffe (http://caffe.berkeleyvision.org/). Pretrained models are imported as a SeriesNetwork or a Directed Acyclic Graph (DAG) network object.
Opening the caffeimporter.mlpkginstall file from your operating system or from within MATLAB will initiate the installation process for the release you have.
This mlpkginstall file is functional for R2017a and beyond.
Usage Example (importCaffeNetwork):
% Specify files to import
protofile = 'digitsnet.prototxt';
datafile = 'digits_iter_10000.caffemodel';
% Import network
net = importCaffeNetwork(protofile,datafile)
Usage Example (importCaffeLayers):
% Specify file to import
protofile = 'digitsnet.prototxt';
% Import network layers
layers = importCaffeLayers('digitsnet.prototxt')
For more information on importing Caffe networks, please visit our documentation at https://www.mathworks.com/help/deeplearning/ref/importcaffenetwork.html
For more information on importing layers from Caffe, please visit our documentation at
https://www.mathworks.com/help/deeplearning/ref/importcaffelayers.html
To get a list of all the pretrained models supported by MATLAB, please visit https://www.mathworks.com/solutions/deep-learning/models.html
Create scripts with code, output, and formatted text in a single executable document.
Rita Li (view profile)
i can not install it
Shounak Mitra (view profile)
Milad,
This support package is compatible with 17a and onwards.
milad eskandari (view profile)
what the reason of this eror ? The support package is not compatible with your version of MATLAB or operating system
Ignacio Arganda-Carreras (view profile)
Sorry, but with the latest version I'm still unable to import a Resnet50 model. This is the error I get:
Error using nnet.internal.cnn.caffe.CaffeModelReader/importSeriesNetwork (line 310)
The network 'ResNet-50' is not determined to be a Series Network. Only series networks can be imported.
Error in importCaffeNetwork (line 84)
network = importSeriesNetwork(readerObj);
Ting Su (view profile)
DAG networks can be imported using the importer released after Sep/12/2018.
Ting Su (view profile)
Hi Ankit,
The digitsnet.prototxt file is shipped with this importer.
ankit khivasara (view profile)
from where to download digitsnet.prototxt file
cui (view profile)
The network 'GoogleNet' is not determined to be a Series Network. Only series networks can be
imported. Can it enhance its versatility?
Baris Ersoy (view profile)
Susmita Dey Manasi (view profile)
Hi I was trying to import SqueezeNet_v_1.0 from caffe. However, I get the following error message:
"The network '' is not determined to be a Series Network. Only series networks can be imported"
Is there any solution to this? It would be really helpful if we could export networks like SqueezeNet, GoogleNet (which contain concat layer) from caffe to matlab.
Serendipity (view profile)
hua ye (view profile)
Hiroyuki Kobayashi (view profile)
Same with adhusch. I would also appreciate if 'Deconbolution' layer is supported..
Jesper Wædeled Henriksen (view profile)
Also support for PReLU layers would be sweet :)
Carl Hart (view profile)
Echoing adhusch's comment: support for 'Deconvolution' layers would be a very practical improvement.
adhusch (view profile)
Would be great if you could support the import of "Deconvolution" (i.e. transposed convolution) layers, enabling the use of U-Nets.
Ignacio Arganda-Carreras (view profile)
Thanks for the nice tool! I got an error though while importing a net:
The pooling layer 'pool2' is not compatible with MATLAB. Caffe computes the output size as [13 13
256] but MATLAB computes it as [12 12 256].
Is there any workaround for this?
Cheng-Chieh Wei (view profile)
Hi, I just wonder is there's any way to transfer "tile" layer of CAFFE to MATLAB.
Huzaifa kapasi (view profile)
cui (view profile)
Philippe Marion (view profile)
Ok, I understood...
the step 3 (previous comment) ./install_supportsoftware.sh -matlabroot $MROOT/R2017a
install effectively importCaffexxxx in the matlbrootdirectory BUT also a lot of stuff in /root/Documents/MATLAB/...
=> Consequentce: only root is able to use the add-ons !!???
Is there an other solution to install an add-on for every user on a platform?
Philippe Marion (view profile)
install on HPC using command line would be great...:
1) first: (no command line) : choose "download" (whearas install in a graphical session)
2) transfer the package to your HPC main node (default download directory : ~/MathWorks/SupportedPackages
3) ./install_supportsoftware.sh -matlabroot $MROOT/R2017a
4) test (the previous example on this page) ... produce the following error:
net = importCaffeNetwork(protofile,datafile)
Error using importCaffeNetwork (line 77)
importCaffeNetwork requires the Neural Network Toolbox Importer for Caffe Models support package. To install this
support package, use the <a href="matlab:
matlab.addons.supportpackage.internal.explorer.showSupportPackages('CAFFEIMPORTER', 'tripwire')">Add-On
Explorer</a>.
=> :-( ???
Ziba Gandomkar (view profile)
I was wondering if there is a way to install this package on the HPC (using command line)? Thanks a heap in advance!
sconly (view profile)
is it not compatible with win10?