Can't "coder.loadDeepLearningNetwork" import a custom network model?
2 次查看(过去 30 天)
显示 更早的评论
When I am going to use GPU Coder to generate cuda code for my custom depth model, matlab2019b unexpectedly terminates, and matlab2019a reports that fopen generates invalid identifier), how can I solve it? In addition, the custom model I imported is also very simple, bvlc's googlenet, not comes with pre-trained googlenet, my code is as follows, the model see attachment (can be loaded to matlab normally, each layer also supports code generation)
my gpu environment is OK:
envCfg = coder.gpuEnvConfig('host');
envCfg.DeepLibTarget = 'cudnn';
envCfg.DeepCodegen = 1;
envCfg.Quiet = 1;
coder.checkGpuInstall(envCfg);
and the code deploy is:
function out = googlenet_predict(in) %#codegen
persistent mynet;
if isempty(mynet)
mynet = coder.loadDeepLearningNetwork('bvlc_googlenet.mat','googlenet'); % can directly load to matlab workspace,but can't load to GPU Coder to generate???
end
% pass in input
out = predict(mynet,in);
The code that generates the configuration is:
cfg = coder.gpuConfig('dll');
cfg.TargetLang = 'C++';
cfg.DeepLearningConfig = coder.DeepLearningConfig('cudnn');
cfg.DeepLearningConfig.AutoTuning = true;
codegen -config cfg googlenet_predict -args {ones(224,224,3)} -report
My matlab version environment is:
MATLAB Version: 9.7.0.1190202 (R2019b)
OS:win10
download model: bvlc_googlenet.mat
0 个评论
回答(1 个)
David Fink
2019-10-14
The crash in R2019b and error in R2019a are not expected.
Please reach out to MathWorks Technical Support with the reproduction steps (as you've described above) and files.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with GPU Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!