Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

深度学习导入和导出

从外部深度学习平台导入和导出网络

从 TensorFlow™-Keras、TensorFlow 2、Caffe 和 ONNX™(开放式神经网络交换)模型格式导入网络和网络架构。您还可以将经过训练的 Deep Learning Toolbox™ 网络导出为 ONNX 模型格式。

函数

全部展开

TensorFlow-Keras 导入

importKerasNetworkImport pretrained Keras network and weights
importKerasLayersImport layers from Keras network
importTensorFlowNetworkImport pretrained TensorFlow network
importTensorFlowLayersImport layers from TensorFlow network

Caffe 导入

importCaffeNetworkImport pretrained convolutional neural network models from Caffe
importCaffeLayersImport convolutional neural network layers from Caffe

ONNX 导入

importONNXNetworkImport pretrained ONNX network
importONNXLayersImport layers from ONNX network
importONNXFunctionImport pretrained ONNX network as a function

importONNXFunction 导入的参数

ONNXParametersParameters of imported ONNX network for deep learning
freezeParametersConvert learnable network parameters in ONNXParameters to nonlearnable
unfreezeParametersConvert nonlearnable network parameters in ONNXParameters to learnable
addParameterAdd parameter to ONNXParameters object
removeParameterRemove parameter from ONNXParameters object
findPlaceholderLayersFind placeholder layers in network architecture imported from Keras or ONNX
replaceLayerReplace layer in layer graph
assembleNetworkAssemble deep learning network from pretrained layers
PlaceholderLayerLayer replacing an unsupported Keras or ONNX layer, or unsupported functionality from functionToLayerGraph
addLayersAdd layers to layer graph
removeLayersRemove layers from layer graph
exportONNXNetworkExport network to ONNX model format

主题

基于预训练的 Keras 层组合网络

此示例说明如何从预训练的 Keras 网络中导入层、用自定义层替换不支持的层,以及将各层组合成可以进行预测的网络。

Deploy Imported Network with MATLAB Compiler

Import Keras and ONNX pretrained networks and deploy the networks using MATLAB® Compiler™.

Select Function to Import ONNX Pretrained Network

Import an ONNX pretrained network using importONNXNetwork, importONNXLayers, or importONNXFunction.