Import pretrained Keras network and weights
ImportKerasnetwork
金宝app支持TensorFlow-keras版本如下:
该函数完全支持TensorFlow-k金宝apperas版本最多2.2.4。
该功能为TensorFlow-Keras版本2.2.5至金宝app2.4.0提供了有限的支持。
如果网络包含一个图层深度学习工具箱转换器用于张量流模型不支持金宝appSupported Keras Layers), 然后ImportKerasnetwork
返回错误消息。在这种情况下,您仍然可以使用ImportKeraslayers
导入网络体系结构和权重。
您可以导入具有多个输入和多个输出(MIMO)的KERAS网络。利用ImportKerasnetwork
如果网络包括输入大小信息,以获取输入和输出的损失信息。否则,请使用ImportKeraslayers
。这ImportKeraslayers
function inserts placeholder layers for the inputs and outputs. After importing, you can find and replace the placeholder layers by usingFindplaceholderlayers
和replaceLayer
, respectively. The workflow for importing MIMO Keras networks is the same as the workflow for importing MIMO ONNX™ networks. For an example, see导入和组装具有多个输出的ONNX网络。要了解具有多个输入和多个输出的深度学习网络,请参见多输入和多输出网络。
To use a pretrained network for prediction or transfer learning on new images, you must preprocess your images in the same way the images that were used to train the imported model were preprocessed. The most common preprocessing steps are resizing images, subtracting image average values, and converting the images from BGR images to RGB.
有关用于培训和预测的预处理图像的更多信息,请参见Preprocess Images for Deep Learning。
利用ImportKerasnetwork
或者ImportKeraslayers
to import a TensorFlow-Keras network in HDF5 or JSON format. If the TensorFlow network is in the saved model format, useImportTensorFlownetwork
或者ImportTensorFlowlayers
。
如果导入自定义TensorFlow-keras层或软件无法将TensorFlow-Keras层转换为等效的内置MATLAB层,则可以使用ImportTensorFlownetwork
或者ImportTensorFlowlayers
,尝试生成自定义层。例如,ImportTensorFlownetwork
和ImportTensorFlowlayers
导入TensorFlow-keras时生成自定义层Lambda
层。
[1]Keras:Python深度学习库。https://keras.io。
进口商人
|importCaffeNetwork
|ImportKeraslayers
|exportONNXNetwork
|ExpientOnnXlayers
|experiponnxnetwork
|ImportTensorFlownetwork
|ImportTensorFlowlayers