C/C++ Code generation for Alexnet without GPU
Afficher commentaires plus anciens
Hello,
I am a hardware guy with little knowlwdge on machine learning thing. I need pure C/C++ code for Alexnet , I am trying to generate the C/C++ code for the alexnet using MATLAB C Coder, but fail to do so.
*my pc does does not have GPU or NVIDIA drivers or libraries etc.
here is my entry function:
function out = alexnet_classify(in)
persistent mynet;
if isempty(mynet)
mynet = coder.loadDeepLearningNetwork('alexnet', 'myalexnet');
out = mynet.predict(in);
end
I am getting the following error:
coder.loadDeepLearningNetwork is only supported for GPU code generation.
please help me
1 commentaire
Raymond Norris
le 19 Oct 2020
Hi Haroon,
Just a quick note, your if statement actually includes the assignment to out, since it requires the end statement. So it really looks like this.
function out = alexnet_classify(in)
persistent mynet;
if isempty(mynet)
mynet = coder.loadDeepLearningNetwork('alexnet', 'myalexnet');
out = mynet.predict(in);
end
Which means if you've already called this code once (and therefore mynet is now initalized) you won't get out assigned. I suspect you want
function out = alexnet_classify(in)
persistent mynet;
if isempty(mynet)
mynet = coder.loadDeepLearningNetwork('alexnet', 'myalexnet');
end
out = mynet.predict(in);
end
This doesn't address your question (which is why I'm only marking it as a Comment).
Raymond
Réponses (0)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!