error using importONNXNetwork, importONNXNetwork cannot be called from compiled applications.

9 ビュー (過去 30 日間)
I used importONNXNetwork in MATLAB R2023b to load a .onnx file, then converted it into a DLL using MATLAB Compiler, and called it under Win64 through Visual Studio 2019. However, when running, I encountered an error: "Error using importONNXNetwork. importONNXNetwork cannot be called from compiled applications." What could be the issue?

採用された回答

Walter Roberson
Walter Roberson 2024 年 3 月 20 日
The issue is that you are not permitted to call importONNXNetwork in a compiled application.
You have to break the code into two pieces. The first piece is not to be compiled; it loads the required network, trains it, and saves the trained network into a .mat file. The second piece is to be compiled; it loads the trained network from the .mat file and uses it to predict() or classify()
In compiled applications, you are limited to loading a trained network and using the trained network. Compiled applications cannot import networks or manipulate the layers or train networks.
  4 件のコメント
Walter Roberson
Walter Roberson 2024 年 3 月 21 日
You need to add
%#function DAGNetwork
as a comment in the code to be deployed.
Alexander Mclean
Alexander Mclean 2024 年 3 月 21 日
Thank you, brother, you are a genius.The problem is solved! ^_^

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Web Services from MATLAB Using HTTP についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by