DenseNet-201 DAGNetwork compilation problem
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,I'm new to MATLAB. I'm using MATLAB to perform transfer learning.
After using transfer learning based on densenet201, I get the DAGNetwork I need and I want to compile a recongnition program (.exe) using MATLAB.
Here is my recongnition program code (combinetest.m):
%MAIN PROGRAM
load('demo1');
while(1)
if (exist('00015.jpg','file') ~=0)
try
I=imread('00015.jpg');
catch
delete('00015.jpg');
continue;
end
m=fishrecon(I,net);
delete('00015.jpg');
fileID = fopen('result.txt','w');
fprintf(fileID,'%s',m);
fclose(fileID);
end
pause(0.5);
end
And fishrecon function (fishrecon.m):
function m=fishrecon(imd,net)
if (ischar(imd))
imd=eval(imd);
end
imd=imresize(imd,[224,224]);
[label,scores] = classify(net, imd);
classNames = net.Layers(end).ClassNames;
m=string(label)+ num2str(100*scores(classNames == label),3) + "%";
'demo1' is the DAGNetwork I got from transfer learning on densenet201.
I compile the MATLAB code with the build-in APP --Application Compiler,but after compilation the program keeps jumping out the error message.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/230038/image.png)
It seems the code below went wrong.
m=fishrecon(I,net);
But the code works fine while using MATLAB editor.
Have anybody encountered this problem? Please help.
0 commentaires
Réponses (1)
Kyle Peterson
le 21 Oct 2019
I am getting the same error when trying to run my compiled code that uses DenseNet-201 to classify images. I found a link on the Matlab documentation that may explain? https://www.mathworks.com/help/coder/ug/networks-and-layers-supported-for-c-code-generation.html
Does this mean that DenseNet-201 cannot be used in the matlab compiler?
0 commentaires
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!