MATLAB Answers

How to export trained Faster RCNN to another hardware platform

20 ビュー (過去 30 日間)
Alberto Tellaeche
Alberto Tellaeche 2019 年 10 月 19 日
Commented: Abdussalam Elhanashi 2019 年 12 月 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 件のコメント

Ganesh Regoti
Ganesh Regoti 2019 年 10 月 24 日
Hi Alberto,
Can you give more information about errors like
1. What are the errors thrown?
2. Which version MATLAB you are using?
When I tried the same functionality, the exportONNXNetwork for the faster RCNN model worked fine.
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) ?

サインイン to comment.

件の回答 (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.

サインイン to comment.


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

  0 件のコメント

サインイン to comment.


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!

  1 件のコメント

Abdussalam Elhanashi
Abdussalam Elhanashi 2019 年 12 月 12 日
after the conversion the pre-trained R-CNN file to ONNX do you have an idea how can be deploy it to the hardware *raspberry
Best
Abdussalam

サインイン to comment.

サインイン してこの質問に回答します。


Translated by