Export network to ONNX model format
Export a trained Deep Learning Toolbox™ network to the ONNX™ (Open Neural Network Exchange) model format. You can then import the ONNX model to other deep learning frameworks that support ONNX model import, such as TensorFlow®, Caffe2, Microsoft® Cognitive Toolkit, Core ML, and Apache MXNet™.
exportONNXNetwork(net,filename)
exportONNXNetwork(net,filename,'NetworkName',netName)
exportONNXNetwork(
exports the deep learning network net
,filename
)net
with weights to the ONNX format file specified by 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
does not export settings or properties related to
network training such as training options, learning rate factors, or regularization
factors.
If the network that you want to export 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. It
is not possible to import the exported ONNX model to other deep learning
frameworks.
exportONNXNetwork
can export the following layers:
All layers in Deep Learning Toolbox except maxUnpooling2dLayer
.
All custom layers 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.
crop2dLayer
and pixelClassificationLayer
(Computer
Vision System Toolbox™).
importCaffeLayers
| importCaffeNetwork
| importKerasLayers
| importKerasNetwork
| importONNXLayers
| importONNXNetwork