Can't "coder.loa​dDeepLearn​ingNetwork​" import a custom network model?

조회 수: 4 (최근 30일)
cui,xingxing
cui,xingxing 2019년 10월 14일
답변: David Fink 2019년 10월 14일
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

답변 (1개)

David Fink
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.

카테고리

Help CenterFile Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by