DenseNet-201 DAGNetwork compilation problem
조회 수: 3 (최근 30일)
이전 댓글 표시
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.
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
답변 (1개)
Kyle Peterson
2019년 10월 21일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!