- [YPred,scores] = classify(net,X)
- [YPred,scores] = classify(net,sequences)
MATLAB Coder class not supported
조회 수: 3 (최근 30일)
이전 댓글 표시
I have the following code for an image classification function:
function out = NNet_Predict(in) %#codegen
persistent NNet;
if isempty(NNet)
NNet = coder.loadDeepLearningNetwork('C:\Users\iacev\Desktop\ImgClass\NNet.mat');
end
out = classify(NNet,in);
end
and the corresponding test file that calls on the function:
clc;
newImage = imread(fullfile('C:\Users\iacev\Desktop\ImgClass\Prueba\106.jpg'));
imageSize = [256 256 3];
in = augmentedImageDatastore(imageSize, newImage, 'ColorPreprocessing','gray2rgb');
y = NNet_Predict(in);
disp(y)
sprintf('The subjects mask is %s', y)
figure
imshow(newImage)
When using MATLAB Coder, i get the following error:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564891/image.png)
what could I do to fix this?
댓글 수: 1
Walter Roberson
2021년 3월 28일
It is true, that kind of data store is not supported for code generation.
The limitations are discussed in https://www.mathworks.com/help/deeplearning/ref/seriesnetwork.classify.html#mw_9fc06d87-a72f-4e03-b313-c82a3b4c1a92
C++ code generation supports the following syntaxes:
That is, do not create an augmented store: do the imresize() yourself and pass the resized image in as image data directly.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!