help on import caffe network

2 views (last 30 days)
Qi Chen
Qi Chen on 3 Apr 2020
Commented: ghada sandoub on 29 Jul 2020
Problem:
I am trying to import a caffe network (https://github.com/WHUQZhang/PSTCR/blob/master/Def/Model.prototxt) to matlab and got the following error:
>> importCaffeLayers('model.prototxt')
Error using nnet.internal.cnn.caffe.CaffeModelReader/makeAdditionLayer (line 1295)
The layer 'anti_mask' specifies an unsupported element-wise operation. Only addition is supported.
Error in nnet.internal.cnn.caffe.CaffeModelReader/importLayers (line 287)
layers(layerIdx) = makeAdditionLayer(this, origLayerIdxInFile);
Error in importCaffeLayers (line 73)
layers = importLayers(readerObj);
Question:
I learnt deep learning via matlab and have no knowledge about caffe at all. But it seems that the problem is caused by the last layer of the caffe model:
layer {
name: "anti_mask"
type: "Eltwise"
bottom: "conv11"
bottom: "data_3"
top: "anti_mask"
eltwise_param {
operation: PROD
}
}
It seems to me that the above layer is to do a pixel-wise multiplication. I assume that Matlab should be able to easily support that. Would you please help how to get around this issue?
  1 Comment
ghada sandoub
ghada sandoub on 29 Jul 2020
Hi Qi Chen,
I hope that you find a solution to your problem. I have the same problem of having no experience in using caffe on Matlab. I have my own convolutional neural network and I want to train the network using Caffe package in Matlab R2018a. I installed the importer for Caffe models in Matlab. I used the following link to guide me how to start using caffe model to train my network step by step https://www.mathworks.com/help/deeplearning/ref/importcaffelayers.html . however I have some questions:
  1. the first step after installing the Caffe package is to download the required support package by typing importCaffeLayers at the command line. however, when I typed this command at the command line , I have the following error:
>> importCaffeLayers
Not enough input arguments.
Error in importCaffeLayers (line 71)
params = nnet.internal.cnn.caffe.CaffeModelReader.parseImportLayers(protofile, varargin{:});
Did you know what does this error mean? and how to fix it?
2. To import the layers of Caffe network I should use the following commands:
Specify the example file 'digitsnet.prototxt' to import.
protofile = 'digitsnet.prototxt';
layers = importCaffeLayers(protofile)
Can you help me on how to prepare the .prototxt file protofile that defines the network layers?
Any help will be appreciated

Sign in to comment.

Answers (1)

Qi Chen
Qi Chen on 3 Apr 2020
The question of lacking a multiplication layer in Matlab was raised more than 1 year ago. I will be very surprised that such a layer still does not exist in Matlab 2020a.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!