Im trying to generate the C++ code for a trained neural network, but i get an error in line 8 about not enough input arguments
Why am i getting 'Not enough input arguments?
4 次查看(过去 30 天)
显示 更早的评论
function out = CodeNNet(in)
persistent NNet
if isempty(NNet)
NNet = coder.loadDeepLearningNetwork('NNet.mat');
end
out = predict(NNet,in);
cfg = coder.config('lib');
cfg.TargetLang = 'C++';
cfg.GenCodeOnly = true;
dlcfg = coder.DeepLearningConfig('arm-compute');
dlcfg.ArmArchitecture = 'armv8';
dlcfg.ArmComputeVersion = '20.02.1';
cfg.DeepLearningConfig = dlcfg;
codegen -args {ones(256,256,3,'single')} -config cfg CodeNNet
11 个评论
Walter Roberson
2021-3-28
The
codegen -args {ones(256,256,3,'single')} -config cfg CodeNNet
should not be part of the source code, and the function name must go before the -args
回答(1 个)
Gaurav Garg
2021-3-30
Hi,
From what seems to be the problem so far-
You should not include
codegen -args {ones(256,256,3,'single')} -config cfg CodeNNet
in your source code.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!