Why is a "DAGNetwork" Object Being Loaded From a MAT File as a "uint32" in a Compiled Application?

32 views (last 30 days)
In MATLAB, I created a "DAGNetwork" object for a "ResNet-18" convolutional neural network and saved the object to a MAT file. The code below demonstrates this process.
net = resnet18;
save myNetFile net;
I created a standalone application by compiling a function which loads this "DAGNetwork" object from the MAT file. However, when I execute the standalone application, the following warning is displayed when the object is loaded:
Warning: Variable 'net' originally saved as a DAGNetwork cannot be instantiated as an object and will be read in as a uint32.
Why is the "DAGNetwork" object loaded from the MAT file as a "uint32"?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 9 Sep 2019
In order for the compiled application to properly use a "DAGNetwork" object representing a "ResNet-18" convolutional neural network, the "Deep Learning Toolbox Model for ResNet-18 Network" support package must be included during compilation.
In order to explicitly include this support package during compilation, follow the steps below.
1) Get the root directory for the MATLAB support packages. This directory can be located by executing the following command in the MATLAB Command Window:
>> matlabshared.supportpkg.getSupportPackageRoot
2) Find the specific directory containing the entire "Deep Learning Toolbox Model for ResNet-18 Network" support package. This directory should be located at:
<support package root>\toolbox\nnet\supportpackages\resnet18
3) When compiling your application, add the directory listed above in the "Files required for your application to run" section of the "Application Compiler" GUI. If you are compiling using the "mcc" command in the MATLAB Command Window, then this directory can be specified using the "-a" option.

More Answers (0)

Categories

Find more on Containers in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!