I tried to generate C++ code for a deep learning neural network in MATLAB. I got the following error
2 ビュー (過去 30 日間)
古いコメントを表示
Naga Sai Pavan Swaroop Ainapurapu
2022 年 7 月 7 日
コメント済み: Naga Sai Pavan Swaroop Ainapurapu
2022 年 7 月 18 日
%%This is where the trained network is called. The trained network is given
%%title as net.mat. I am also uploading the trained network for reference. The trained network can be opened using deep leanring netowrk model designer app.
function label = classifyX (y) %#codegen
%CLASSIFYX Classify using SVM Model
% CLASSIFYX classifies the measurements in X
% using the SVM model in the file mySVM.mat, and then
% returns class labels in label.
persistent CompactMdl;
if isempty(CompactMdl)
CompactMdl = coder.loadDeepLearningNetwork('net.mat');
end
label = predict(CompactMdl,y);
end
Error Message:
Error generating code for network.
Code generation for FeatureInputLayer input is not supported for mkldnn target.
See documentation for a list of supported layers with each target.
My Approach to Error:
I tried going through the webpage for understanding the various functions supported by MKLDNN. And Feauture input Layer is included. But I dont understand why it is still showing likewise.
About the model:
The trained networks looks like this. It was working fine with inputs given in MATLAB. But I am facing error duing code generation.
The use case and the inputs matches with the approach descirbed in:
The difference is that I have modelled the input in simulink and created a funciton block with the model.
4 件のコメント
Bill Chou
2022 年 7 月 18 日
Great, that explains it. Yes go ahead and try R2021a or newer, that should resolve the issue.
FYI you can see layer/network support for a specific release of MATLAB by going to:
- https://www.mathworks.com/help/releases/R2020b/coder/ug/networks-and-layers-supported-for-c-code-generation.html
- https://www.mathworks.com/help/releases/R2021a/coder/ug/networks-and-layers-supported-for-c-code-generation.html
- https://www.mathworks.com/help/releases/R2021b/coder/ug/networks-and-layers-supported-for-c-code-generation.html
- https://www.mathworks.com/help/releases/R2022a/coder/ug/networks-and-layers-supported-for-c-code-generation.html
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!