Export network to ONNX model format
Export a trained Deep Learning Toolbox™ network to the ONNX™ (Open Neural Network Exchange) model format.
exportONNXNetwork(
exports the deep learning network net
,filename
)net
with weights to the ONNX format file filename
. If
filename
exists, then exportONNXNetwork
overwrites the
file.
This function requires the Deep Learning Toolbox Converter for ONNX Model Format support package. If this support package is not installed, then the function provides a download link.
exportONNXNetwork(
exports a network using additional options specified by one or more name-value pair
arguments.net
,filename
,Name,Value
)
exportONNXNetwork
does not export settings or properties related to
network training such as training options, learning rate factors, or regularization
factors.
If you export a network that contains a layer that the ONNX format does not support, then exportONNXNetwork
saves a
placeholder ONNX operator in place of the unsupported
layer and returns a warning. You cannot import an ONNX network with a placeholder operator into other deep learning
frameworks.
exportONNXNetwork
can export the following:
Networks that have both convolutional and LSTM layers, for example, for video classification applications.
All custom layers that are created when importing networks from ONNX or TensorFlow™-Keras using Deep Learning Toolbox Converter for ONNX Model Format or Deep Learning Toolbox Importer for TensorFlow-Keras Models as in the below table.
The following layers:
importCaffeLayers
| importCaffeNetwork
| importKerasLayers
| importKerasNetwork
| importONNXLayers
| importONNXNetwork