run the executable on the PC without Deep Learning Toolbox installed

I installed Matlab R2022a on my PC, Deep Learning Toolbox is also installed. I used the functions of Deep Learning Toolbox in my code, then build a Matlab executable.
I want to run this Matlab executable on another PC, Matlab Runtime R2022a is installed on this PC, I found Deep Learning Toolbox is not installed, Matlab executable crash when running on this PC.
Do you know how to install Deep Learning Toolbox in Matlab Runtime? or how can I run the executable on the PC without Deep Learning Toolbox installed?

Answers (1)

You cannot compile any of the learning / training functions of Deep Learning Toolbox.
You can however train a network beforehand, save the network to a .mat file, and then construct different code that load()'s the network and uses it for prediction or classification, and compile that code.

4 Comments

Thanks your help.
I save the imported network to a MAT file.
nnet = importONNXLayers(modelPath, ...);
nnetwork = assembleNetwork(nnet);
save("model.mat","nnetwork");
Then use .mat for prediction:
load("model.mat","nnetwork");
out = predict(nnetwork,data);
While predict is a function of Deep Learning Toolbox.
I want to do prediction on the PC without Deep Learning Toolbox installed.
When you use that form of load(), the variable "poofs" into existence, and MATLAB does not know it has been created. You should use
%#function dlnetwork
datacell = load("model.mat","nnetwork");
nnetwork = datacell.nnetwork;
It is possible that you might need to name some other class on the %#function line.
Note that if you want to use predict() then you need to do
nnet = importONNXLayers(modelPath, ...);
nnetwork = dlnetwork(nnet);
save("model.mat","nnetwork");
Using assembleNetwork like you did would be for the case where you planned to use classify()
thanks your help.
Is there a way to install the deep learning toolbox in Runtime?

Sign in to comment.

Categories

Products

Release

R2022a

Asked:

bo
on 14 Apr 2023

Commented:

on 19 Apr 2023

Community Treasure Hunt

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

Start Hunting!