Borrar filtros
Borrar filtros

Compiled app from App Designer can't recognize 'DAGNetwork'.

6 visualizaciones (últimos 30 días)
Wei-Rong Chen
Wei-Rong Chen el 30 de Sept. de 2021
Comentada: Wei-Rong Chen el 16 de Abr. de 2024
I trained a U-Net model using 'unetLayers.m' and tried to read this model from an Matlab App.
It works fine with Matlab App but failed to read this model from the compiled standalone App.
I got this error message:
Warning: Variable 'net' originally saved as a DAGNetwork cannot be instantiated as an object and will be read in as a uint32.
I found this thread related to my question:
but the solution provided in this thread didn't work with my issue.
Any clue is appreciated!
Thanks!

Respuesta aceptada

Pratik
Pratik el 16 de Abr. de 2024
Editada: Pratik el 16 de Abr. de 2024
Hi Wei-Rong Chen,
As per my understanding, issue you're encountering involves the behavior of MATLAB's App Designer and its compiled standalone applications when dealing with 'DAGNetwork' objects, specifically a U-Net model created with unetLayers.m. While your application functions as expected within MATLAB, the compiled version fails to properly load the 'DAGNetwork' object from a .mat file, instead loading it as a uint32 data type.
The current issue appears to be caused by the fact that DAGNetwork is not recognised as an object, because Deep Learning Toolbox is not included when compiling the standalone application. Additionally, code requires elements from the Computer Vision Toolbox, since this model is for image processing. Since model is in a .mat file the dependency analysis ran by MATLAB when compiling your application does not see that these toolboxes are required.   
To resolve this issue, function pragma that refers to the Deep Learning Toolbox and the Computer Vision Toolbox can be added to the code. This will tell MATLAB to include the necessary toolboxes when compiling the application. Please refer to the following snippet:
%#function nnet.cnn.layer.PixelClassificationLayer  
After recompiling the application, the compiler will see the pragma and should include the Deep Learning and Computer Vision Toolboxes. This should allow the program to recognize the DAGNetwork object and resolve the error.
Please refer to the documentation of Function Pragmas for more information:
I hope this helps!

Más respuestas (0)

Categorías

Más información sobre MATLAB Web App Server en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by