From d5a5dc1aa11004d1163976716fb9d7f52a35746a Mon Sep 17 00:00:00 2001 From: Bo Liu Date: Wed, 27 Oct 2021 07:02:21 +0800 Subject: [PATCH] doc of paddle 2nd batch operations support (#7952) * doc of paddle 2nd batch operations support * Modified based on UX/DX Team feedback * update the example command in Convert_Model_From_Paddle.m * Apply suggestions from code review Co-authored-by: Tatiana Savina Co-authored-by: meiyang-intel Co-authored-by: Tatiana Savina --- docs/IE_DG/Paddle_Support.md | 40 +- .../Supported_Frameworks_Layers.md | 1093 +++++++++-------- .../Convert_Model_From_Paddle.md | 18 +- 3 files changed, 582 insertions(+), 569 deletions(-) diff --git a/docs/IE_DG/Paddle_Support.md b/docs/IE_DG/Paddle_Support.md index 03dddc6cdcc..43b94d9396b 100644 --- a/docs/IE_DG/Paddle_Support.md +++ b/docs/IE_DG/Paddle_Support.md @@ -1,34 +1,52 @@ -# Paddle Support in the OpenVINO™ {#openvino_docs_IE_DG_Paddle_Support} +# Paddle Support in OpenVINO™ {#openvino_docs_IE_DG_Paddle_Support} Starting from the 2022.1 release, OpenVINO™ supports reading native Paddle models. -`Core::ReadNetwork()` method provides a uniform way to read models from IR or Paddle format, it is a recommended approach to reading models. +The `Core::ReadNetwork()` method provides a uniform way to read models from either the Paddle format or IR, which is the recommended approach. ## Read Paddle Models from IR -After [Converting a Paddle Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md) to [Intermediate Representation (IR)](../MO_DG/IR_and_opsets.md), it can be read as recommended. Example: +The Paddle Model can be read after it is [converted](../MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md) to [Intermediate Representation (IR)](../MO_DG/IR_and_opsets.md). + +**C++ Example:** ```cpp InferenceEngine::Core core; auto network = core.ReadNetwork("model.xml"); ``` -## Read Paddle Models from Paddle Format (Paddle `inference model` model type) +**Python Example:** -**Example:** +```sh +from openvino.inference_engine import IECore +ie = IECore() +net = ie.read_network("model.xml") +``` + +## Read Paddle Models from The Paddle Format (Paddle `inference model` model type) + +**C++ Example:** ```cpp InferenceEngine::Core core; auto network = core.ReadNetwork("model.pdmodel"); ``` -**Reshape feature:** +**Python Example:** -OpenVINO™ does not provide a mechanism to specify pre-processing, such as mean values subtraction and reverse input channels, for the Paddle format. +```sh +from openvino.inference_engine import IECore +ie = IECore() +net = ie.read_network("model.pdmodel") +``` + +**The Reshape feature:** + +OpenVINO™ does not provide a mechanism to specify pre-processing, such as mean values subtraction or reverse input channels, for the Paddle format. If a Paddle model contains dynamic shapes for input, use the `CNNNetwork::reshape` method for shape specialization. -## NOTE +## NOTES -* Paddle [`inference model`](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/inference_en.md) mainly contains two kinds of files `model.pdmodel`(model file) and `model.pdiparams`(params file), which are used for inference. -* Supported Paddle models list and how to export these models are described in [Convert a Paddle Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md). +* The Paddle [`inference model`](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/inference_en.md) mainly contains two kinds of files `model.pdmodel`(model file) and `model.pdiparams`(params file), which are used for inference. +* The list of supported Paddle models and a description of how to export them can be found in [Convert a Paddle Model](../MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md). * For `Normalize` Paddle Models, the input data should be in FP32 format. -* When reading Paddle models from Paddle format, make sure that `model.pdmodel` and `model.pdiparams` are in the same folder directory. +* When reading Paddle models from The Paddle format, make sure that `model.pdmodel` and `model.pdiparams` are in the same folder directory. diff --git a/docs/MO_DG/prepare_model/Supported_Frameworks_Layers.md b/docs/MO_DG/prepare_model/Supported_Frameworks_Layers.md index 42468e1d82f..1a8070e4dc4 100644 --- a/docs/MO_DG/prepare_model/Supported_Frameworks_Layers.md +++ b/docs/MO_DG/prepare_model/Supported_Frameworks_Layers.md @@ -2,680 +2,683 @@ ## Caffe\* Supported Layers -Standard Caffe\* layers: | Layer Name in Caffe\* | Limitations | |:---------- | :----------| -| Axpy | No | -| BN | No | -| BatchNorm | No | -| Bias | No | -| Binarization (Intel experimental) | No | -| Concat | No | -| Convolution | No | -| ConvolutionBinary | No | -| Crop | No | -| Deconvolution | No | -| DetectionOutput | No | +| Axpy | | +| BN | | +| BatchNorm | | +| Bias | | +| Binarization (Intel experimental) | | +| Concat | | +| Convolution | | +| ConvolutionBinary | | +| Crop | | +| Deconvolution | | +| DetectionOutput | | | Dropout | Not needed for inference | -| Eltwise | No | -| Flatten | No | -| GlobalInput | No | -| InnerProduct | No | -| Input | No | -| LRN | No | -| Normalize | No | +| Eltwise | | +| Flatten | | +| GlobalInput | | +| InnerProduct | | +| Input | | +| LRN | | +| Normalize | | | Python | Supported only for the Python Proposal operation | -| Permute | No | -| Pooling | No | -| Power | No | -| PReLU | No | -| PriorBox | No | -| PriorBoxClustered | No | -| Proposal | No | -| PSROIPooling | No | -| ROIPooling | No | -| RegionYolo | No | -| ReorgYolo | No | -| ReLU | No | -| Resample | No | -| Reshape | No | -| Scale | No | -| ShuffleChannel | No | -| Sigmoid | No | -| Slice | No | -| Softmax | No | -| Tile | No | +| Permute | | +| Pooling | | +| Power | | +| PReLU | | +| PriorBox | | +| PriorBoxClustered | | +| Proposal | | +| PSROIPooling | | +| ROIPooling | | +| RegionYolo | | +| ReorgYolo | | +| ReLU | | +| Resample | | +| Reshape | | +| Scale | | +| ShuffleChannel | | +| Sigmoid | | +| Slice | | +| Softmax | | +| Tile | | ## MXNet\* Supported Symbols -Standard MXNet\* symbols: | Symbol Name in MXNet\*| Limitations| | :----------| :----------| -| _Plus | No | -| _contrib_box_nms | No | -| _contrib_DeformableConvolution | No | -| _contrib_DeformablePSROIPooling | No | +| _Plus | | +| _contrib_box_nms | | +| _contrib_DeformableConvolution | | +| _contrib_DeformablePSROIPooling | | | _contrib_MultiBoxDetection | "force_suppress" = 1 is not supported, non-default variances are not supported | -| _contrib_MultiBoxPrior | No | -| _contrib_Proposal | No | +| _contrib_MultiBoxPrior | | +| _contrib_Proposal | | | _copy | Not needed for inference | -| _div_scalar | No | -| _greater_scalar | No | -| _minus_scalar | No | -| _mul_scalar | No | -| _plus_scalar | No | +| _div_scalar | | +| _greater_scalar | | +| _minus_scalar | | +| _mul_scalar | | +| _plus_scalar | | | _random_uniform | Operation provides sequence from uniform distribution, but exact values won't match. | -| _rnn_param_concat | No | -| _arange | No | +| _rnn_param_concat | | +| _arange | | | _contrib_AdaptiveAvgPooling2D | Converted to the Average Pooling with fixed paddings | -| _maximum | No | -| _minimum | No | -| _np_roll | No | -| _zeros | No | -| add_n | No | -| arccosh | No | -| arcsinh | No | -| arctanh | No | -| broadcast_add | No | -| broadcast_div | No | -| broadcast_mul | No | -| broadcast_sub | No | -| BlockGrad | No | -| cumsum | No | -| div_scalar | No | -| elementwise_sub | No | -| elemwise_add | No | -| elemwise_mul | No | -| elemwise_sub | No | -| exp | No | -| expand_dims | No | -| greater_scalar | No | -| max | No | -| minus_scalar | No | +| _maximum | | +| _minimum | | +| _np_roll | | +| _zeros | | +| add_n | | +| arccosh | | +| arcsinh | | +| arctanh | | +| broadcast_add | | +| broadcast_div | | +| broadcast_mul | | +| broadcast_sub | | +| BlockGrad | | +| cumsum | | +| div_scalar | | +| elementwise_sub | | +| elemwise_add | | +| elemwise_mul | | +| elemwise_sub | | +| exp | | +| expand_dims | | +| greater_scalar | | +| max | | +| minus_scalar | | | null | Not needed for inference | -| repeat | No | -| rnn | No | -| rnn_param_concat | No | -| round | No | -| sigmoid | No | -| slice | No | -| SliceChannel | No | -| slice_axis | No | -| slice_channel | No | -| slice_like | No | -| softmax | No | -| stack | No | -| swapaxis | No | -| tile | No | -| transpose | No | -| zeros | No | +| repeat | | +| rnn | | +| rnn_param_concat | | +| round | | +| sigmoid | | +| slice | | +| SliceChannel | | +| slice_axis | | +| slice_channel | | +| slice_like | | +| softmax | | +| stack | | +| swapaxis | | +| tile | | +| transpose | | +| zeros | | | Activation | supported "act_type" = "relu", "sigmoid", "softrelu" or "tanh" | -| BatchNorm | No | -| Concat | No | -| Convolution | No | +| BatchNorm | | +| Concat | | +| Convolution | | | Crop | "center_crop" = 1 is not supported | | Custom | [Custom Layers in the Model Optimizer](customize_model_optimizer/Customize_Model_Optimizer.md) | -| Deconvolution | No | -| DeformableConvolution | No | -| DeformablePSROIPooling | No | +| Deconvolution | | +| DeformableConvolution | | +| DeformablePSROIPooling | | | Dropout | Not needed for inference | -| ElementWiseSum | No | -| Embedding | No | -| Flatten | No | -| FullyConnected | No | -| InstanceNorm | No | +| ElementWiseSum | | +| Embedding | | +| Flatten | | +| FullyConnected | | +| InstanceNorm | | | L2Normalization | only 4D input is supported | -| LRN | No | +| LRN | | | LeakyReLU | supported "act_type" = "prelu", "elu", "leaky", "gelu" | -| ones_like | No | -| Pad | No | -| Pooling | No | -| ROIPooling | No | -| ReLU | No | -| Reshape | No | -| ScaleShift | No | -| SoftmaxActivation | No | -| SoftmaxOutput | No | -| SoftSign | No | +| ones_like | | +| Pad | | +| Pooling | | +| ROIPooling | | +| ReLU | | +| Reshape | | +| ScaleShift | | +| SoftmaxActivation | | +| SoftmaxOutput | | +| SoftSign | | | Take | The attribute 'mode' is not supported | -| Tile | No | -| UpSampling | No | -| Where | No | -| zeros_like | No | +| Tile | | +| UpSampling | | +| Where | | +| zeros_like | | ## TensorFlow\* Supported Operations Some TensorFlow\* operations do not match to any Inference Engine layer, but are still supported by the Model Optimizer and can be used on constant propagation path. These layers are labeled 'Constant propagation' in the table. -Standard TensorFlow\* operations: | Operation Name in TensorFlow\* | Limitations| | :----------| :----------| -| Abs | No | -| Acosh | No | -| Add | No | -| AddV2 | No | -| AddN | No | -| All | No | -| ArgMax | No | -| ArgMin | No | -| Asinh | No | +| Abs | | +| Acosh | | +| Add | | +| AddV2 | | +| AddN | | +| All | | +| ArgMax | | +| ArgMin | | +| Asinh | | | Assert | Not needed for inference | | Assign | Not needed for inference | | AssignSub | Not needed for inference | -| Atanh | No | -| AvgPool | No | +| Atanh | | +| AvgPool | | | AvgPoolV2 | Supported only for constant-foldable kernel_size and strides inputs | -| AvgPool3D | No | -| BatchMatMul | No | -| BatchMatMulV2 | No | -| BatchToSpaceND | No | -| BiasAdd | No | -| BlockLSTM | No | +| AvgPool3D | | +| BatchMatMul | | +| BatchMatMulV2 | | +| BatchToSpaceND | | +| BiasAdd | | +| BlockLSTM | | | Bucketize | CPU only | -| BroadcastTo | No | -| Cast | No | -| Ceil | No | -| ClipByValue | No | -| Concat | No | -| ConcatV2 | No | -| Const | No | -| Conv2D | No | -| Conv2DBackpropInput | No | -| Conv3D | No | -| Conv3DBackpropInputV2 | No | -| Cos | No | -| Cosh | No | +| BroadcastTo | | +| Cast | | +| Ceil | | +| ClipByValue | | +| Concat | | +| ConcatV2 | | +| Const | | +| Conv2D | | +| Conv2DBackpropInput | | +| Conv3D | | +| Conv3DBackpropInputV2 | | +| Cos | | +| Cosh | | | CropAndResize | "method" = "bilinear" only | | CTCGreedyDecoder | Supported only with decoded indices output in a dense format | | CTCLoss | Supported only with decoded indices input in a dense format | -| CumSum | No | -| DepthToSpace| No | -| DepthwiseConv2dNative| No | +| CumSum | | +| DepthToSpace| | +| DepthwiseConv2dNative| | | Einsum | Supported only with equation that does not contain repeated labels within a subscript | -| Elu | No | +| Elu | | | Enter | Supported only when it is fused to the TensorIterator layer | -| Equal | No | -| Erf | No | +| Equal | | +| Erf | | | Exit | Supported only when it is fused to the TensorIterator layer | -| Exp | No | -| ExpandDims | No | +| Exp | | +| ExpandDims | | | ExperimentalSparseWeightedSum | CPU only | -| ExtractImagePatches | No | -| EuclideanNorm | No | -| FakeQuantWithMinMaxVars | No | -| FakeQuantWithMinMaxVarsPerChannel | No | +| ExtractImagePatches | | +| EuclideanNorm | | +| FakeQuantWithMinMaxVars | | +| FakeQuantWithMinMaxVarsPerChannel | | | FFT | Supported only when it is part of a sub-graph of the special form | | FFT2D | Supported only when it is part of a sub-graph of the special form | | FFT3D | Supported only when it is part of a sub-graph of the special form | | FIFOQueueV2 | Supported only when it is part of a sub-graph of the special form | -| Fill | No | -| Floor | No | -| FloorDiv | No | -| FloorMod | No | -| FusedBatchNorm | No | -| FusedBatchNormV2 | No | -| FusedBatchNormV3 | No | -| Gather | No | -| GatherNd | No | -| GatherTree | No | -| GatherV2 | No | -| Greater | No | -| GreaterEqual | No | +| Fill | | +| Floor | | +| FloorDiv | | +| FloorMod | | +| FusedBatchNorm | | +| FusedBatchNormV2 | | +| FusedBatchNormV3 | | +| Gather | | +| GatherNd | | +| GatherTree | | +| GatherV2 | | +| Greater | | +| GreaterEqual | | | Identity | Not needed for shape inference | -| IdentityN | No | +| IdentityN | | | IFFT | Supported only when it is part of a sub-graph of the special form | | IFFT2D | Supported only when it is part of a sub-graph of the special form | | IFFT3D | Supported only when it is part of a sub-graph of the special form | | IteratorGetNext | Supported only when it is part of a sub-graph of the special form | -| LRN | No | -| LeakyRelu | No | -| Less | No | -| LessEqual | No | -| Log | No | -| Log1p | No | -| LogicalAnd | No | -| LogicalOr | No | -| LogicalNot | No | -| LogSoftmax | No | +| LRN | | +| LeakyRelu | | +| Less | | +| LessEqual | | +| Log | | +| Log1p | | +| LogicalAnd | | +| LogicalOr | | +| LogicalNot | | +| LogSoftmax | | | LookupTableInsertV2 | Supported only when it is part of a sub-graph of the special form | | LoopCond | Supported only when it is fused to the TensorIterator layer | -| MatMul | No | -| Max | No | -| MaxPool | No | +| MatMul | | +| Max | | +| MaxPool | | | MaxPoolV2 | Supported only for constant-foldable kernel_size and strides inputs | -| MaxPool3D | No | -| Maximum | No | -| Mean | No | +| MaxPool3D | | +| Maximum | | +| Mean | | | Merge | Supported only when it is fused to the TensorIterator layer | -| Min | No | -| Minimum | No | -| MirrorPad | No | -| Mod | No | -| Mul | No | -| Neg | No | +| Min | | +| Minimum | | +| MirrorPad | | +| Mod | | +| Mul | | +| Neg | | | NextIteration | Supported only when it is fused to the TensorIterator layer | -| NonMaxSuppressionV2 | No | -| NonMaxSuppressionV3 | No | -| NonMaxSuppressionV4 | No | -| NonMaxSuppressionV5 | No | -| NotEqual | No | -| NoOp | No | -| OneHot | No | -| Pack | No | -| Pad | No | -| PadV2 | No | -| Placeholder | No | -| PlaceholderWithDefault | No | -| Prod | No | +| NonMaxSuppressionV2 | | +| NonMaxSuppressionV3 | | +| NonMaxSuppressionV4 | | +| NonMaxSuppressionV5 | | +| NotEqual | | +| NoOp | | +| OneHot | | +| Pack | | +| Pad | | +| PadV2 | | +| Placeholder | | +| PlaceholderWithDefault | | +| Prod | | | QueueDequeueUpToV2 | Supported only when it is part of a sub-graph of the special form | -| RandomUniform | No | -| RandomUniformInt | No | -| Range | No | -| Rank | No | -| RealDiv | No | -| Reciprocal | No | -| Relu | No | -| Relu6 | No | -| Reshape | No | -| ResizeBilinear | No | -| ResizeNearestNeighbor | No | -| ResourceGather| No | -| ReverseSequence | No | -| ReverseV2 | Supported only when can be converted to the ReverseSequence operation | -| Roll | No | -| Round | No | -| Pow | No | -| Rsqrt | No | -| Select | No | -| SelectV2 | No | -| Shape | No | -| Sigmoid | No | -| Sin | No | -| Sinh | No | -| Size | No | -| Slice | No | -| Softmax | No | -| Softplus | No | -| Softsign | No | -| SpaceToBatchND | No | -| SpaceToDepth | No | +| RandomUniform | | +| RandomUniformInt | | +| Range | | +| Rank | | +| RealDiv | | +| Reciprocal | | +| Relu | | +| Relu6 | | +| Reshape | | +| ResizeBilinear | | +| ResizeNearestNeighbor | | +| ResourceGather| | +| ReverseSequence | | +| ReverseV2 | Supported only when it can be converted to the ReverseSequence operation | +| Roll | | +| Round | | +| Pow | | +| Rsqrt | | +| Select | | +| SelectV2 | | +| Shape | | +| Sigmoid | | +| Sin | | +| Sinh | | +| Size | | +| Slice | | +| Softmax | | +| Softplus | | +| Softsign | | +| SpaceToBatchND | | +| SpaceToDepth | | | SparseFillEmptyRows | Supported only when it is part of a sub-graph of the special form | | SparseReshape | Supported only when it is part of a sub-graph of the special form | | SparseSegmentSum | Supported only when it is part of a sub-graph of the special form | | SparseToDense | CPU only | -| Split | No | -| SplitV | No | -| Sqrt | No | -| Square | No | -| SquaredDifference | No | -| Square| No | +| Split | | +| SplitV | | +| Sqrt | | +| Square | | +| SquaredDifference | | +| Square| | | Squeeze | The case when squeeze axis is not specified is not supported | -| StatelessWhile | No | +| StatelessWhile | | | StopGradient | Not needed for shape inference | | StridedSlice | Supported only for constant-foldable begin, end, and strides inputs | -| Sub | No | -| Sum | No | -| Swish | No | -| swish_f32 | No | +| Sub | | +| Sum | | +| Swish | | +| swish_f32 | | | Switch | Control flow propagation | -| Tan | No | -| Tanh | No | +| Tan | | +| Tanh | | | TensorArrayGatherV3 | Supported only when it is fused to the TensorIterator layer | | TensorArrayReadV3 | Supported only when it is fused to the TensorIterator layer | | TensorArrayScatterV3 | Supported only when it is fused to the TensorIterator layer | | TensorArraySizeV3 | Supported only when it is fused to the TensorIterator layer | | TensorArrayV3 | Supported only when it is fused to the TensorIterator layer | | TensorArrayWriteV3 | Supported only when it is fused to the TensorIterator layer | -| Tile | No | -| TopkV2 | No | -| Transpose | No | -| Unpack | No | -| Variable | No | -| VariableV2 | No | +| Tile | | +| TopkV2 | | +| Transpose | | +| Unpack | | +| Variable | | +| VariableV2 | | | Where | Supported only when it is part of a sub-graph of the special form | -| ZerosLike | No | +| ZerosLike | | ## TensorFlow 2 Keras\* Supported Operations -Standard TensorFlow 2 Keras\* operations: | Operation Name in TensorFlow 2 Keras\* | Limitations| | :----------| :----------| -| ActivityRegularization | No | -| Add | No | -| AdditiveAttention | No | -| AlphaDropout | No | -| Attention | No | -| Average | No | -| AveragePooling1D | No | -| AveragePooling2D | No | -| AveragePooling3D | No | -| BatchNormalization | No | -| Bidirectional | No | -| Concatenate | No | -| Conv1D | No | +| ActivityRegularization | | +| Add | | +| AdditiveAttention | | +| AlphaDropout | | +| Attention | | +| Average | | +| AveragePooling1D | | +| AveragePooling2D | | +| AveragePooling3D | | +| BatchNormalization | | +| Bidirectional | | +| Concatenate | | +| Conv1D | | | Conv1DTranspose | Not supported if dilation is not equal to 1 | -| Conv2D | No | -| Conv2DTranspose | No | -| Conv3D | No | -| Conv3DTranspose | No | -| Cropping1D | No | -| Cropping2D | No | -| Cropping3D | No | -| Dense | No | +| Conv2D | | +| Conv2DTranspose | | +| Conv3D | | +| Conv3DTranspose | | +| Cropping1D | | +| Cropping2D | | +| Cropping3D | | +| Dense | | | DenseFeatures | Not supported for categorical and crossed features | -| DepthwiseConv2D | No | -| Dot | No | -| Dropout | No | -| ELU | No | -| Embedding | No | -| Flatten | No | -| GRU | No | -| GRUCell | No | -| GaussianDropout | No | -| GaussianNoise | No | -| GlobalAveragePooling1D | No | -| GlobalAveragePooling2D | No | -| GlobalAveragePooling3D | No | -| GlobalMaxPool1D | No | -| GlobalMaxPool2D | No | -| GlobalMaxPool3D | No | -| LSTM | No | -| LSTMCell | No | -| Lambda | No | -| LayerNormalization | No | -| LeakyReLU | No | -| LocallyConnected1D | No | -| LocallyConnected2D | No | -| MaxPool1D | No | -| MaxPool2D | No | -| MaxPool3D | No | -| Maximum | No | -| Minimum | No | -| Multiply | No | -| PReLU | No | -| Permute | No | +| DepthwiseConv2D | | +| Dot | | +| Dropout | | +| ELU | | +| Embedding | | +| Flatten | | +| GRU | | +| GRUCell | | +| GaussianDropout | | +| GaussianNoise | | +| GlobalAveragePooling1D | | +| GlobalAveragePooling2D | | +| GlobalAveragePooling3D | | +| GlobalMaxPool1D | | +| GlobalMaxPool2D | | +| GlobalMaxPool3D | | +| LSTM | | +| LSTMCell | | +| Lambda | | +| LayerNormalization | | +| LeakyReLU | | +| LocallyConnected1D | | +| LocallyConnected2D | | +| MaxPool1D | | +| MaxPool2D | | +| MaxPool3D | | +| Maximum | | +| Minimum | | +| Multiply | | +| PReLU | | +| Permute | | | RNN | Not supported for some custom cells | -| ReLU | No | -| RepeatVector | No | -| Reshape | No | -| Roll | No | -| SeparableConv1D | No | -| SeparableConv2D | No | -| SimpleRNN | No | -| SimpleRNNCell | No | -| Softmax | No | -| SpatialDropout1D | No | -| SpatialDropout2D | No | -| SpatialDropout3D | No | -| StackedRNNCells | No | -| Subtract | No | -| ThresholdedReLU | No | -| TimeDistributed | No | -| UpSampling1D | No | -| UpSampling2D | No | -| UpSampling3D | No | -| ZeroPadding1D | No | -| ZeroPadding2D | No | -| ZeroPadding3D | No | +| ReLU | | +| RepeatVector | | +| Reshape | | +| Roll | | +| SeparableConv1D | | +| SeparableConv2D | | +| SimpleRNN | | +| SimpleRNNCell | | +| Softmax | | +| SpatialDropout1D | | +| SpatialDropout2D | | +| SpatialDropout3D | | +| StackedRNNCells | | +| Subtract | | +| ThresholdedReLU | | +| TimeDistributed | | +| UpSampling1D | | +| UpSampling2D | | +| UpSampling3D | | +| ZeroPadding1D | | +| ZeroPadding2D | | +| ZeroPadding3D | | ## Kaldi\* Supported Layers -Standard Kaldi\* Layers: | Symbol Name in Kaldi\*| Limitations| | :----------| :----------| -| addshift | No | -| affinecomponent | No | -| affinecomponentpreconditionedonline | No | -| affinetransform | No | -| backproptruncationcomponent | No | -| batchnormcomponent | No | +| addshift | | +| affinecomponent | | +| affinecomponentpreconditionedonline | | +| affinetransform | | +| backproptruncationcomponent | | +| batchnormcomponent | | | clipgradientcomponent | Not needed for inference | -| concat | No | -| convolutional1dcomponent | No | -| convolutionalcomponent | No | -| copy | No | -| dropoutmaskcomponent | No | -| elementwiseproductcomponent | No | -| fixedaffinecomponent | No | -| fixedbiascomponent | No | -| fixedscalecomponent | No | +| concat | | +| convolutional1dcomponent | | +| convolutionalcomponent | | +| copy | | +| dropoutmaskcomponent | | +| elementwiseproductcomponent | | +| fixedaffinecomponent | | +| fixedbiascomponent | | +| fixedscalecomponent | | | generaldropoutcomponent| Not needed for inference | -| linearcomponent | No | -| logsoftmaxcomponent | No | -| lstmnonlinearitycomponent | No | -| lstmprojected | No | -| lstmprojectedstreams | No | -| maxpoolingcomponent | No | -| naturalgradientaffinecomponent | No | -| naturalgradientperelementscalecomponent | No | +| linearcomponent | | +| logsoftmaxcomponent | | +| lstmnonlinearitycomponent | | +| lstmprojected | | +| lstmprojectedstreams | | +| maxpoolingcomponent | | +| naturalgradientaffinecomponent | | +| naturalgradientperelementscalecomponent | | | noopcomponent | Not needed for inference | -| normalizecomponent | No | -| parallelcomponent | No | -| pnormcomponent | No | -| rectifiedlinearcomponent | No | -| rescale | No | -| sigmoid | No | -| sigmoidcomponent | No | -| softmax | No | -| softmaxComponent | No | +| normalizecomponent | | +| parallelcomponent | | +| pnormcomponent | | +| rectifiedlinearcomponent | | +| rescale | | +| sigmoid | | +| sigmoidcomponent | | +| softmax | | +| softmaxComponent | | | specaugmenttimemaskcomponent | Not needed for inference | -| splicecomponent | No | -| tanhcomponent | No | -| tdnncomponent | No | -| timeheightconvolutioncomponent | No | +| splicecomponent | | +| tanhcomponent | | +| tdnncomponent | | +| timeheightconvolutioncomponent | | ## ONNX\* Supported Operators -Standard ONNX\* operators: | Symbol Name in ONNX\*| Limitations| | :----------| :----------| -| Abs | No | -| Acos | No | -| Acosh | No | -| Add | No | -| Affine | No | -| And | No | -| ArgMax | No | -| ArgMin | No | -| Asin | No | -| Asinh | No | -| Atan | No | -| Atanh | No | +| Abs | | +| Acos | | +| Acosh | | +| Add | | +| Affine | | +| And | | +| ArgMax | | +| ArgMin | | +| Asin | | +| Asinh | | +| Atan | | +| Atanh | | | ATen | Supported only for the 'embedding_bag' operator | -| AveragePool | No | -| BatchMatMul | No | -| BatchNormalization | No | -| Cast | No | -| Ceil | No | -| Clip | No | -| Concat | No | -| Constant | No | -| ConstantFill | No | -| ConstantOfShape | No | -| Conv | No | +| AveragePool | | +| BatchMatMul | | +| BatchNormalization | | +| Cast | | +| Ceil | | +| Clip | | +| Concat | | +| Constant | | +| ConstantFill | | +| ConstantOfShape | | +| Conv | | | ConvTranspose | | -| Cos | No | -| Cosh | No | -| Crop | No | -| CumSum | No | -| DepthToSpace | No | -| DequantizeLinear | No | -| DetectionOutput (Intel experimental) | No | -| Div | No | +| Cos | | +| Cosh | | +| Crop | | +| CumSum | | +| DepthToSpace | | +| DequantizeLinear | | +| DetectionOutput (Intel experimental) | | +| Div | | | Dropout | Not needed for inference | -| Elu | No | -| Equal | No | -| Erf | No | -| Exp | No | -| Expand | No | -| ExperimentalDetectronDetectionOutput (Intel experimental) | No | -| ExperimentalDetectronGenerateProposalsSingleImage (Intel experimental) | No | -| ExperimentalDetectronGroupNorm (Intel experimental) | No | -| ExperimentalDetectronPriorGridGenerator (Intel experimental) | No | -| ExperimentalDetectronROIFeatureExtractor (Intel experimental) | No | -| ExperimentalDetectronTopKROIs (Intel experimental) | No | -| FakeQuantize (Intel experimental) | No | -| Fill | No | -| Flatten | No | -| Floor | No | -| GRU | No | -| Gather | No | +| Elu | | +| Equal | | +| Erf | | +| Exp | | +| Expand | | +| ExperimentalDetectronDetectionOutput (Intel experimental) | | +| ExperimentalDetectronGenerateProposalsSingleImage (Intel experimental) | | +| ExperimentalDetectronGroupNorm (Intel experimental) | | +| ExperimentalDetectronPriorGridGenerator (Intel experimental) | | +| ExperimentalDetectronROIFeatureExtractor (Intel experimental) | | +| ExperimentalDetectronTopKROIs (Intel experimental) | | +| FakeQuantize (Intel experimental) | | +| Fill | | +| Flatten | | +| Floor | | +| GRU | | +| Gather | | | GatherElements | Doesn't work with negative indices | -| GatherND | No | -| GatherTree | No | -| Gemm | No | -| GlobalAveragePool | No | -| GlobalMaxPool | No | -| Greater | No | -| GreaterEqual | No | -| HardSigmoid | No | +| GatherND | | +| GatherTree | | +| Gemm | | +| GlobalAveragePool | | +| GlobalMaxPool | | +| Greater | | +| GreaterEqual | | +| HardSigmoid | | | Identity | Not needed for inference | -| ImageScaler | No | -| InstanceNormalization | No | -| LRN | No | +| ImageScaler | | +| InstanceNormalization | | +| LRN | | | LSTM | Peepholes are not supported | -| LeakyRelu | No | -| Less | No | -| LessEqual | No | -| Log | No | -| LogicalAnd | No | -| LogicalOr | No | -| LogSoftmax | No | -| Loop | No | -| LpNormalization | No | -| MatMul | No | -| Max | No | -| MaxPool | No | +| LeakyRelu | | +| Less | | +| LessEqual | | +| Log | | +| LogicalAnd | | +| LogicalOr | | +| LogSoftmax | | +| Loop | | +| LpNormalization | | +| MatMul | | +| Max | | +| MaxPool | | | MeanVarianceNormalization | Reduction over the batch dimension is not supported, reduction over all dimensions except batch and channel ones is obligatory | -| Min | No | -| Mul | No | -| Neg | No | -| NonMaxSuppression | No | -| NonZero | No | -| Not | No | -| NotEqual | No | -| OneHot | No | -| Pad | No | -| Pow | No | -| PriorBox (Intel experimental) | No | -| PriorBoxClustered | No | -| QuantizeLinear | No | -| RNN | No | -| ROIAlign | No | -| Range | No | +| Min | | +| Mul | | +| Neg | | +| NonMaxSuppression | | +| NonZero | | +| Not | | +| NotEqual | | +| OneHot | | +| Pad | | +| Pow | | +| PriorBox (Intel experimental) | | +| PriorBoxClustered | | +| QuantizeLinear | | +| RNN | | +| ROIAlign | | +| Range | | | RandomUniform | Operation provides sequence from uniform distribution, but exact values won't match. | -| Reciprocal | No | -| ReduceL1 | No | -| ReduceL2 | No | -| ReduceMax | No | -| ReduceMean | No | -| ReduceMin | No | -| ReduceProd | No | -| ReduceSum | No | -| Relu | No | -| Reshape | No | +| Reciprocal | | +| ReduceL1 | | +| ReduceL2 | | +| ReduceMax | | +| ReduceMean | | +| ReduceMin | | +| ReduceProd | | +| ReduceSum | | +| Relu | | +| Reshape | | | Resize | Coordinate transformation mode `tf_crop_and_resize` is not supported, `nearest` mode is not supported for 5D+ inputs. | -| ReverseSequence | No | -| Round | No | +| ReverseSequence | | +| Round | | | Scatter | Supported if fuse-able to ScatterUpdate. MYRIAD only | -| ScatterND | No | +| ScatterND | | | ScatterElements | Supported if fuse-able to ScatterUpdate. MYRIAD only | -| Select | No | -| Shape | No | -| Sigmoid | No | -| Sign | No | -| Sin | No | -| Size | No | -| Slice | No | -| Softmax | No | -| Softplus | No | -| Softsign | No | -| SpaceToDepth | No | -| Split | No | -| Sqrt | No | +| Select | | +| Shape | | +| Sigmoid | | +| Sign | | +| Sin | | +| Size | | +| Slice | | +| Softmax | | +| Softplus | | +| Softsign | | +| SpaceToDepth | | +| Split | | +| Sqrt | | | Squeeze | The case when squeeze axis is not specified is not supported | -| Sub | No | -| Sum | No | -| Tan | No | -| Tanh | No | -| ThresholdedRelu | No | -| TopK | No | -| Transpose | No | -| Unsqueeze | No | -| Upsample | No | -| Where | No | -| Xor | No | +| Sub | | +| Sum | | +| Tan | | +| Tanh | | +| ThresholdedRelu | | +| TopK | | +| Transpose | | +| Unsqueeze | | +| Upsample | | +| Where | | +| Xor | | ## PaddlePaddle\* Supported Operators -Standard PaddlePaddle(paddlepaddle>=2.1)\* Operators: +paddlepaddle>=2.1 | Operator Name in PaddlePaddle\*| Limitations| | :----------| :----------| | adpative_pool2d | 'NHWC' data_layout is not supported | | arg_max | 'int32' output data_type is not supported | -| assign_value | No | -| batch_norm | No | +| assign_value | | +| batch_norm | | | bilinear_interp | 'NCW' 'NWC' 'NHWC' 'NCDHW' 'NDHWC' data_layout are not supported | | bilinear_interp_v2 | 'NCW' 'NWC' 'NHWC' 'NCDHW' 'NDHWC' data_layout are not supported | -| bmm | No | -| cast | No | -| clip | No | -| concat | No | +| bmm | | +| cast | | +| clip | | +| concat | | | conv2d | 'NHWC' data_layout is not supported | | depthwise_conv2d | 'NHWC' data_layout is not supported | -| deformable_conv | No | -| elementwise_add | No | -| elementwise_div | No | -| elementwise_max | No | -| elementwise_min | No | -| elementwise_mul | No | -| elementwise_pow | No | -| elementwise_sub | No | -| equal | No | -| expand_v2 | No | -| fill_constant_batch_size_like | No | -| fill_constant | No | -| flatten_contiguous_range | No | -| greater_equal | No | -| hard_sigmoid | No | -| hard_swish | No | -| leaky_relu | No | -| log | No | -| logical_not | No | -| matmul | No | -| matrix_nms | Only supports IE CPU plugin with 'number of selected boxes' static shape(eg: min(min(num_boxes, nms_top_k) * num_classes_output, keep_top_k)) | -| max_pool2d_with_index | No | -| mul | No | -| multiclass_nms | Only supports IE CPU plugin with 'number of selected boxes' static shape(eg: min(min(num_boxes, nms_top_k) * num_classes_output, keep_top_k)) | +| deformable_conv | | +| elementwise_add | | +| elementwise_div | | +| elementwise_max | | +| elementwise_min | | +| elementwise_mul | | +| elementwise_pow | | +| elementwise_sub | | +| equal | | +| expand_v2 | | +| exp | | +| fill_any_like | | +| fill_constant_batch_size_like | | +| fill_constant | | +| flatten_contiguous_range | | +| gelu | | +| greater_equal | | +| hard_sigmoid | | +| hard_swish | | +| layer_norm | | +| leaky_relu | | +| log | | +| logical_not | | +| lookup_table_v2 | | +| matmul | | +| matmul_v2 | | +| matrix_nms | Only supports IE CPU plugin with 'number of selected boxes' static shape(e.g.: min(min(num_boxes, nms_top_k) * num_classes_output, keep_top_k)) | +| max_pool2d_with_index | | +| mul | | +| multiclass_nms3 | Only supports IE CPU plugin with 'number of selected boxes' static shape(e.g.: min(min(num_boxes, nms_top_k) * num_classes_output, keep_top_k)) | | nearest_interp | 'NCW' 'NWC' 'NHWC' 'NCDHW' 'NDHWC' data_layout are not supported | | nearest_interp_v2 | 'NCW' 'NWC' 'NHWC' 'NCDHW' 'NDHWC' data_layout are not supported | | pad3d | 'Circular' mode is not supported | -| pow | No | +| pow | | | pool2d | 'NHWC' data_layout is not supported | -| range | No | -| relu | No | -| relu6 | No | -| reshape2 | No | +| prior_box | | +| range | | +| relu | | +| relu6 | | +| reshape2 | | | rnn | 'SimpleRNN' and 'GRU' modes are not supported | -| scale | No | -| shape | No | -| slice | No | -| softmax | No | -| sigmoid | No | -| split | No | -| squeeze2 | No | -| transpose2 | No | -| unsqueeze2 | No | -| yolo_box | No | +| scale | | +| shape | | +| slice | | +| softmax | | +| sigmoid | | +| split | | +| squeeze2 | | +| stack | | +| tanh | | +| transpose2 | | +| unsqueeze2 | | +| yolo_box | | diff --git a/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md b/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md index d2d75aefb08..51f12ef1a19 100644 --- a/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md +++ b/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md @@ -1,9 +1,9 @@ # Converting a Paddle* Model {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle} -A summary of the steps for optimizing and deploying a model that was trained with Paddle\*: +A summary of the steps for optimizing and deploying a model trained with Paddle\*: 1. [Configure the Model Optimizer](../Config_Model_Optimizer.md) for Paddle\*. -2. [Convert a Paddle\* Model](#Convert_From_Paddle) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases values. +2. [Convert a Paddle\* Model](#Convert_From_Paddle) to produce an optimized [Intermediate Representation (IR)](../../IR_and_opsets.md) of the model based on the trained network topology, weights, and biases. 3. Test the model in the Intermediate Representation format using the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in the target environment via provided Inference Engine [sample applications](../../../IE_DG/Samples_Overview.md). 4. [Integrate](../../../IE_DG/Samples_Overview.md) the [Inference Engine](../../../IE_DG/Deep_Learning_Inference_Engine_DevGuide.md) in your application to deploy the model in the target environment. @@ -38,12 +38,12 @@ python3 mo.py --input_model .pdmodel --output_dir **NOTE:** `--scale`, `--scale_values`, `--mean_values`, `--mean_file` are unsupported in the current version of mo_paddle. +> **NOTE:** `--scale`, `--scale_values`, `--mean_values`, `--mean_file` are not supported in the current version of mo_paddle. ### Example of Converting a Paddle* Model Below is the example command to convert yolo v3 Paddle\* network to OpenVINO IR network with Model Optimizer. ```sh -python3 mo.py --model_name yolov3_darknet53_270e_coco --output_dir --framework=paddle --data_type=FP32 --reverse_input_channels --input_shape=[2,3,608,608],[1,2],[1,2] --input=image,im_shape,scale_factor --output=save_infer_model/scale_0.tmp_1,save_infer_model/scale_1.tmp_1 --input_model=yolov3.pdmodel +python3 mo.py --model_name yolov3_darknet53_270e_coco --output_dir --framework=paddle --data_type=FP32 --reverse_input_channels --input_shape=[1,3,608,608],[1,2],[1,2] --input=image,im_shape,scale_factor --output=save_infer_model/scale_0.tmp_1,save_infer_model/scale_1.tmp_1 --input_model=yolov3.pdmodel ``` ## Supported Paddle\* Layers @@ -51,12 +51,4 @@ Refer to [Supported Framework Layers](../Supported_Frameworks_Layers.md) for the ## Frequently Asked Questions (FAQ) -The Model Optimizer provides explanatory messages if it is unable to run to completion due to issues like typographical errors, incorrectly used options, or other issues. The message describes the potential cause of the problem and gives a link to the [Model Optimizer FAQ](../Model_Optimizer_FAQ.md). The FAQ has instructions on how to resolve most issues. The FAQ also includes links to relevant sections in the Model Optimizer Developer Guide to help you understand what went wrong. - -## Summary - -In this document, you learned: - -* Basic information about how the Model Optimizer works with Paddle\* models -* Which Paddle\* models are supported -* How to convert a trained Paddle\* model using the Model Optimizer with framework-agnostic command-line options +When Model Optimizer is unable to run to completion due to issues like typographical errors, incorrectly used options, etc., it provides explanatory messages. They describe the potential cause of the problem and give a link to the [Model Optimizer FAQ](../Model_Optimizer_FAQ.md), which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in the Model Optimizer Developer Guide to help you understand what went wrong.