How to load trained R-CNN model to SIMULINK
Mostrar comentarios más antiguos
Below is the MATLAB code that I used to train my R-CNN Object Detector
rcnn = trainRCNNObjectDetector(ROI, cifar10Net, options, ...
'NegativeOverlapRange', [0 0.3], 'PositiveOverlapRange',[0.5 1])
save('C:\Users\PC1\Desktop\rcnn_Model_2.mat','rcnn');
Now my problem is the blocks like 'from File' in SIMULINK can not take any MAT file that are not timeseries object.
Below in the data format that I saved using the codes above,
Name Size Bytes Class Attributes
rcnn 1x1 482631 rcnnObjectDetector
Below is the properties of the model after being loaded,
rcnn =
rcnnObjectDetector with properties:
Network: [1×1 SeriesNetwork]
ClassNames: {'Left' 'Stop' 'Go' 'Right' 'Background'}
RegionProposalFcn: @rcnnObjectDetector.proposeRegions
So, is that any possible way to import the trained network to SIMULINK?
2 comentarios
De M
el 9 de Mayo de 2019
Movida: Walter Roberson
el 25 de Mzo. de 2025
Me too
michael bronnmann
el 21 de Ag. de 2019
Movida: Walter Roberson
el 25 de Mzo. de 2025
Any news on this topic? I have a similar topic to use a trained model in Simulink. Has anyone an idea how to export the net to e.g. c++ for use within a sfunction?
Respuesta aceptada
Más respuestas (3)
Walter Roberson
el 11 de Dic. de 2016
0 votos
You could possibly create a Simulink bus object with custom signals. However, I find no evidence that Simulink has any cnn related blocks, so you would have to be doing everything opaquely though a MATLAB Function Block or Level 2 MATLAB function. I suspect that it would not be possible to use it with any accelation mode other than "normal" or "accelerated" (using coder.extrinsic), not rapid accelation or code generation. I have not cross-checked that limitation though.
2 comentarios
Khai Hong Chin
el 11 de Dic. de 2016
Walter Roberson
el 11 de Dic. de 2016
Nothing in the Neural Network Toolbox is supported by Simulink Coder http://www.mathworks.com/help/simulink/ug/functions-supported-for-code-generation--alphabetical-list.html; not much of the Neural Network Toolbox is supported for MATLAB Compiler; https://www.mathworks.com/products/compiler/supported/compiler_support.html. For MATLAB Coder https://www.mathworks.com/help/coder/ug/functions-supported-for-code-generation--categorical-list.html#buimyq3 see https://www.mathworks.com/help/nnet/ug/deploy-neural-network-functions-and-objects.html which will point you to genFunction which will generate code to deploy an already-trained Neural Network.
Jonathan Akorli
el 10 de Mzo. de 2020
0 votos
Try using a MATLAB Interpreted function. You may have to use mapminmax to map the function block but its worth a try
1 comentario
michael bronnmann
el 11 de Mzo. de 2020
Thanks for your answer. In the meanwhile I took a MATLAB Fcn block for "Shallow Neural Networks". They can be exported to either a m-function or a Simulink model.
Unfortunately there's no conversion possible from a Deep Neural Network.
Cesar García Echeverry
el 29 de Jun. de 2021
0 votos
Did you solved the problem? i want to load a .net from Matlab to Simulink, but i'm having the same problem.
Regrads
3 comentarios
Muhammad Faisal Khalid
el 16 de Oct. de 2021
did u find the solution as i am also facing same problem
nes
el 26 de Mayo de 2024
please have you find the solution i'm facing the same problem
Cesar García Echeverry
el 27 de Mayo de 2024
Yeap, first, when you have your .net created in matlab workspace, you need to use 'load net.mat' and then 'gensim(net)', this will use your created .net in matlab to create an obect in simulink that you can use.
Categorías
Más información sobre Deep Learning with Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!