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?

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 4 月 14 日

0 投票

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 件のコメント

bo
bo 2023 年 4 月 14 日
編集済み: Walter Roberson 2023 年 4 月 14 日
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.
Walter Roberson
Walter Roberson 2023 年 4 月 14 日
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()
bo
bo 2023 年 4 月 19 日
thanks your help.
Is there a way to install the deep learning toolbox in Runtime?
Steven Lord
Steven Lord 2023 年 4 月 19 日
See your other question about the MATLAB Runtime.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2022a

タグ

質問済み:

bo
2023 年 4 月 14 日

コメント済み:

2023 年 4 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by