필터 지우기
필터 지우기

Why do I get a warning when I load a neural network object in a compiled application?

조회 수: 9 (최근 30일)
I have stored neural network objects in a MAT file and have created and compiled the following function:
function try_to_open
load my_nn_objs.mat;
Executing try_to_open inside of MATLAB works as expected. However if I compile the function using the following command:
mcc -m try_to_open.m
I get the following warning:
Warning: Class ':all:' is an unknown object class. Object '' of this
class has been converted to a structure.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2012년 9월 24일
To make the compiler aware of the neural network objects, modify the following directive in your function:
%#function network
For example:
function try_to_open
%#function network
load my_nn_objs.mat;

추가 답변 (1개)

Oleksii Sidorov
Oleksii Sidorov 2018년 7월 25일
I faced the same issue installing Inception-ResNet-v2,
most probably it is caused by the fact that definition of DAGNetwork contains layers which are NOT default in NN Toolbox. These "new" layers are downloaded and installed together with add-on. So, logically, without them network model has a "reference" on layers which are not exist.
I solved this issue by copying whole add-on's directory and running inceptionresnetv2.m file instead of just loading data from inceptionresnetv2.mat. In this way model is imported together with layers.
  댓글 수: 1
Oleksii Sidorov
Oleksii Sidorov 2018년 7월 25일
You also need to copy that custom layers to your working dir, and add it to matlab path like following:
exampleFolder = genpath(fullfile(pwd));
addpath(exampleFolder)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 AI for Wireless에 대해 자세히 알아보기

제품


릴리스

R14SP2

Community Treasure Hunt

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

Start Hunting!

Translated by