Main Content

深度学习导入和导出

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

从 TensorFlow™ 2、TensorFlow-Keras、PyTorch®、ONNX™(开放式神经网络交换)模型格式和 Caffe 中导入网络和层图。您还可以将 Deep Learning Toolbox™ 网络和层图导出为 TensorFlow 2 和 ONNX 模型格式。有关详细信息,请参阅预训练的深度神经网络Interoperability Between Deep Learning Toolbox, TensorFlow, PyTorch, and ONNX

您必须有支持包才能在 Deep Learning Toolbox 中运行导入和导出函数。如果未安装支持包,则每个函数都会在附加功能资源管理器中提供对应支持包的下载链接。建议将支持包下载到您正在运行的 MATLAB® 版本的默认位置。您也可以从以下链接直接下载支持包。

函数

全部展开

TensorFlow 导入

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

PyTorch 导入

importNetworkFromPyTorchImport PyTorch model as MATLAB 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
functionLayerFunction layer
findPlaceholderLayersFind placeholder layers in network architecture imported from Keras or ONNX
replaceLayerReplace layer in layer graph or network
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 or network
removeLayersRemove layers from layer graph or network
exportNetworkToTensorFlowExport Deep Learning Toolbox network or layer graph to TensorFlow
exportONNXNetworkExport network to ONNX model format

主题