Application Compiler, error with an executable : importONNXNetwork requires the Deep Learning Toolbox Converter for ONNX Model

4 visualizzazioni (ultimi 30 giorni)
I am trying to make an executable of a Matlab code using the Deep Learning Toolbox with Application Compiler.
The created executable make an error and display the following message:
matlab error.png
I have checked on the Add-On Explorer, the "Deep Learning Toolbox Converter for ONNX Model Format " is installed on my Matlab and the importONNXNetwork.m is automatically added to the list of "Files required for your application to run" in the Application Compiler.
The line 5 of test.m is the only use of the importONNXNetwork function:
modelfile = "AlexNet_pretrain_and_fit.onnx";
%testvie = uigetfile(pwd, "Neural network file");
classes = {'-1' '0' '1'};
outputtype = 'classification';
net = importONNXNetwork(modelfile,'OutputLayerType','classification',"Classes", classes) %line 5
To solve my problem I tried to:
  • Put the toolxbox folder in the same directory than test.m and compile.
  • Put the importONNXNetwork.m file in the same folder and add it to the list of files required for my application to run in the Application Compiler.
  • I check that Deep Learning Toolbox is supported by Application compiler, not all command are supported but I seem ok for importONNXNetwork.
  2 Commenti
Leopold LR
Leopold LR il 6 Gen 2020
Hi,
I try again my code and I still have this problem. So I write this code;
modelfile = "AlexNet_pretrain_and_fit.onnx";
%testvie = uigetfile(pwd, "Neural network file");
classes = {'-1' '0' '1'};
outputtype = 'classification';
net = importONNXNetwork(modelfile,'OutputLayerType','classification',"Classes", classes)
%image_path = uigetdir(pwd, "Images folder"); %open local folder
image_path = "raw_images"
images_to_classify = imageDatastore(image_path);
images_to_classify.ReadFcn = @readFunctionTrain;
predictedLabels = [images_to_classify.Files , classify(net, images_to_classify)];
writematrix( predictedLabels , "results.csv")
Then I transform it in executable with "Application Compiler" (I use the defaults parameters).
Then I install the app and run it. Then it trow the importONNXNetwork error.
Personaly,since July I jump to Python to solve this problem, but it can help other people to solve it.

Accedi per commentare.

Risposte (5)

CHANGYUAN
CHANGYUAN il 23 Gen 2020
Hi Leopold ,
I ran into the similar issue, and it got fixed. You may refer to my question and answer:

Yusuke Konno
Yusuke Konno il 5 Dic 2019
I have same issue.

Hari Krishna Ravuri
Hari Krishna Ravuri il 7 Gen 2020
I have heard that this issue is known and the concerned parties may be investigating further.

Jan
Jan il 21 Gen 2020
I just ran into the same issue when trying to deploy a Matlab executable for DeepLearning.
HR, since this appears to be a known problem, could you give us an estimate on a fix?
Thanks!

Sivylla Paraskevopoulou
Sivylla Paraskevopoulou il 9 Mag 2022
The Deploy Imported Network with MATLAB Compiler example can help you with your workflow. If you are using a MATLAB version older than R2021b, you must manually specify the path to the ONNX layers folder. Note that you can deploy only the imported network using MATLAB Compiler. You cannot deploy import functions, such as importTensorFlowNetwork and importONNXNetwork.
  6 Commenti

Accedi per commentare.

Categorie

Scopri di più su Deep Learning Toolbox in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by