How to export trained Faster RCNN to another hardware platform

조회 수: 1 (최근 30일)
Alberto Tellaeche
Alberto Tellaeche 2019년 10월 19일
댓글: Abdussalam Elhanashi 2020년 2월 12일
Hello all,
I have used MATLAB with the deep learning toolbox to train my own Faster RCNN object detector.
Either if I use a predefined CNN (squeezenet for example) or my designed CNN, I want to export the trained Faster RCNN to use it on other embedded platforms.
exportONNXNetwork gives errors with Faster RCNN architectures no matter the CNN used.
How can I export my work to use it in another HW? I have worked many hours and now I can not deploy my design !!
Thank you all in advance,
Alberto
  댓글 수: 3
Alberto Tellaeche
Alberto Tellaeche 2019년 10월 24일
Hi,
I can provide an example. Ihave a fasterRCNNObjectDetector trained using the squeezenet network model.
Here is the output of MATLAB 2019b when trying to export. It only happens with the faster RCNN models. It seems to work with FastRCNN or RCNN.
Thank you all in advance,
Alberto
>> load('ResultsFasterRCNN_squeezenet.mat')
>> exportONNXNetwork(detector.Network,'test.onnx')
Warning: ONNX does not support layer 'nnet.cnn.layer.RPNSoftmaxLayer'. Exporting to ONNX operator
'com.MathWorks.Placeholder'.
> In nnet.internal.cnn.onnx/NNTLayerConverter/makeLayerConverter (line 212)
In nnet.internal.cnn.onnx/ConverterForNetwork/networkToGraphProto (line 100)
In nnet.internal.cnn.onnx/ConverterForNetwork/toOnnx (line 44)
In nnet.internal.cnn.onnx.exportONNXNetwork (line 35)
In exportONNXNetwork (line 40)
Warning: ONNX does not support layer 'nnet.cnn.layer.RPNClassificationLayer'. Exporting to ONNX operator
'com.MathWorks.Placeholder'.
> In nnet.internal.cnn.onnx/NNTLayerConverter/makeLayerConverter (line 212)
In nnet.internal.cnn.onnx/ConverterForNetwork/networkToGraphProto (line 100)
In nnet.internal.cnn.onnx/ConverterForNetwork/toOnnx (line 44)
In nnet.internal.cnn.onnx.exportONNXNetwork (line 35)
In exportONNXNetwork (line 40)
Warning: ONNX does not support layer 'nnet.cnn.layer.RegionProposalLayer'. Exporting to ONNX operator
'com.MathWorks.Placeholder'.
> In nnet.internal.cnn.onnx/NNTLayerConverter/makeLayerConverter (line 212)
In nnet.internal.cnn.onnx/ConverterForNetwork/networkToGraphProto (line 100)
In nnet.internal.cnn.onnx/ConverterForNetwork/toOnnx (line 44)
In nnet.internal.cnn.onnx.exportONNXNetwork (line 35)
In exportONNXNetwork (line 40)
Error using nnet.internal.cnn.onnx.ConverterForClassificationOutputLayer/toOnnx (line 28)
Assertion failed.
Error in nnet.internal.cnn.onnx.ConverterForNetwork/networkToGraphProto (line 102)
= toOnnx(layerConverter, nodeProtos, TensorNameMap, TensorLayoutMap);
Error in nnet.internal.cnn.onnx.ConverterForNetwork/toOnnx (line 44)
modelProto.graph = networkToGraphProto(this);
Error in nnet.internal.cnn.onnx.exportONNXNetwork (line 35)
modelProto = toOnnx(converter);
Error in exportONNXNetwork (line 40)
nnet.internal.cnn.onnx.exportONNXNetwork(Network, filename, varargin{:});
>>
Ganesh Regoti
Ganesh Regoti 2019년 10월 25일
Hi Alberto,
It seemed to work fine for me for the following network. I am able to export the network to ONNX format.
Could you send your network (ResultsFasterRCNN_squeezenet.mat) ?

댓글을 달려면 로그인하십시오.

답변 (3개)

Alberto Tellaeche
Alberto Tellaeche 2019년 10월 25일
Hi Ganesh,
Please find attached my .mat file.
I would like to export the detector.Network network.
Best,
Alberto
  댓글 수: 1
Ganesh Regoti
Ganesh Regoti 2019년 10월 25일
Hi,
The attached .mat file is empty. Can you please cross-verify and attach the correct file.

댓글을 달려면 로그인하십시오.


Alberto Tellaeche
Alberto Tellaeche 2019년 10월 25일
Sorry for the inconveniences,
I have just done now drag and drop of the .mat containing the netwrok.
Let`s see if now it is correct...
Sorry again,
Alberto

Ganesh Regoti
Ganesh Regoti 2019년 11월 4일
Hi Alberto,
I have tried it on the latest version of MATLAB R2019b and it worked fine for me.
1. Try updating / re-installing to the latest version of MATLAB R2019b.
2. Try re-installing the Deep Learning Toolbox.
Hope this helps!

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by