Main Content

Deep Learning Import and Export

Import networks from and export networks to external deep learning platforms

Import networks and network architectures from TensorFlow™-Keras, TensorFlow 2, the ONNX™ (Open Neural Network Exchange) model format, and Caffe. You can also export a trained Deep Learning Toolbox™ network to the ONNX model format. For more information, seePretrained Deep Neural Networks.

You must have support packages to run the import and export functions in Deep Learning Toolbox. If the support package is not installed, each function provides a download link to the corresponding support package in the Add-On Explorer. A recommended practice is to download the support package to the default location for the version of MATLAB®you are running. You can also directly download the support packages from the following links.

Functions

expand all

TensorFlowImport

importTensorFlowNetwork Import pretrainedTensorFlownetwork
importTensorFlowLayers Import layers fromTensorFlownetwork
importKerasNetwork Import pretrained Keras network and weights
importKerasLayers Import layers from Keras network

Caffe Import

importCaffeNetwork Import pretrained convolutional neural network models from Caffe
importCaffeLayers Import convolutional neural network layers from Caffe

ONNXImport

importONNXNetwork Import pretrainedONNXnetwork
importONNXLayers Import layers fromONNXnetwork
importONNXFunction Import pretrained ONNX network as a function

Parameters Imported byimportONNXFunction

ONNXParameters Parameters of importedONNXnetwork for deep learning
freezeParameters Convert learnable network parameters inONNXParametersto nonlearnable
unfreezeParameters Convert nonlearnable network parameters inONNXParametersto learnable
addParameter Add parameter toONNXParametersobject
removeParameter Remove parameter fromONNXParametersobject
functionLayer Function layer
findPlaceholderLayers Find placeholder layers in network architecture imported from Keras orONNX
replaceLayer Replace layer in layer graph
assembleNetwork Assemble deep learning network from pretrained layers
PlaceholderLayer Layer replacing an unsupported Keras orONNXlayer, or unsupported functionality fromfunctionToLayerGraph
addLayers Add layers to layer graph
removeLayers Remove layers from layer graph
exportONNXNetwork Export network toONNX模型格式

Topics