フィルターのクリア

MATLAB Coder class not supported

2 ビュー (過去 30 日間)
Ignacio Acevedo
Ignacio Acevedo 2021 年 3 月 28 日
コメント済み: Walter Roberson 2021 年 3 月 28 日
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:
what could I do to fix this?
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 3 月 28 日
It is true, that kind of data store is not supported for code generation.
C++ code generation supports the following syntaxes:
  • [YPred,scores] = classify(net,X)
  • [YPred,scores] = classify(net,sequences)
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 ExchangeDeep Learning Code Generation Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by