Deploy ANN model Developed using ann fitting app using Matlab Compiler

조회 수: 4 (최근 30일)
Learning
Learning 2023년 5월 9일
댓글: Learning 2023년 5월 9일
Hi everyone,
I have developed an ANN model using the ANN fitting app (used nnstart at the command line to get the app interface). I am trying to come up with a code before I deploy it using Matlab compiler. I saved the exported ANN model the workspace as trainedmodel. I then saved it to path as myANN. trainedmodel is a structure containing 'Network'. The code I'm using is below
function predict = mypredict(test_data)
load('myANN')
pred = sim(trainedmodel.Network, test_data);
end
I keep getting an error. For the code above, I want to load myANN which contains trainedmodel. I am then extracting the 'Network' from it and making new predictions on new data called test_data. Error read" mypredict requires more input arguments to run. After this I will package it as a standalone program using the Matlab compiler.
Any ideas? Thanks!

답변 (1개)

Steven Lord
Steven Lord 2023년 5월 9일
If you are attempting to compile code using MATLAB Compiler that calls load to load an object from a MAT-file and there is no indication in the code itself that MATLAB Compiler needs to package the code, the dependency analyzer may not be able to detect that it needs to include the definition of the class. In this case use one of the workarounds in the "Fixing Callback Problems: Missing Functions" section of this documentation page, as this workflow is described by the Tip in that section of that documentation page.
  댓글 수: 1
Learning
Learning 2023년 5월 9일
I am a bit confused since I’m still new to Matlab. The thing is I am able to make predictions using
pred = sim(trainedmodel.Network, test_data.
Any specific code example? Thank you!

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

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by