How to deal Found unsupported class for variable using function 'load'. The value at 'mynet1.net' is unsupported for code generation.

조회 수: 19 (최근 30일)
I am running a deep learning model to control a system that has been designed using Deep netwoek designer. However, the simulink model gave me an error in this type"
Found unsupported class for variable using function 'load'. The value at 'mynet1.net' is unsupported for code generation."
"Use the command 'whos -file NET.mat' to view the variables in the MAT file."
The code in the block function is given by:
function out = predict(in)
x1=in(1);
x2=in(2);
persistent mynet1;
if isempty(mynet1)
mynet1 = load("NET.mat","net","-mat");
end
out = predict(mynet1,[x1;x2])
end

답변 (1개)

Sayan Saha
Sayan Saha 2022년 5월 19일
Deep learning networks aren't supported to be loaded via "coder.load" for code generation. You should use "coder.loadDeepLearningNetwork" instead. Here is a reference page that shows the workflow: https://www.mathworks.com/help/coder/ug/load-pretrained-networks-for-code-generation.html

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by