Why do I get warnings and errors about an "uninitialized dlnetwork" when importing an Deep Learning network from a third-party framework (ONNX, TensorFlow, PyTorch, etc.) into MATLAB, or exporting it to Simulink?
Show older comments
When I import my ONNX model into MATLAB using "importNetworkFromONNX", I get the following error:
>> net = importNetworkFromONNX('model.onnx');
Warning: Returning an uninitialized dlnetwork because some input layers have unknown data formats or
undetermined image sizes. Initialize the network by passing example input data to the initialize object function.
>> net = importNetworkFromTensorFlow(modelFolder);
Warning: Network is imported as an uninitialized dlnetwork object. Before using the network, add input layer(s):
>> net = importNetworkFromPyTorch(modelfile)
Warning: Network was imported as an uninitialized dlnetwork. Before using the network, add input layer(s):
Then, when I try to import this dlnetwork into Simulink via the "exportNetworkToSimulink" function, I get an error:
>> exportNetworkToSimulink(net)
Error using exportNetworkToSimulink
Uninitialized dlnetwork object. Initialize and train network before calling exportNetworkToSimulink.
Accepted Answer
More Answers (0)
Categories
Find more on Pretrained Networks from External Platforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!