@ -2,11 +2,11 @@
@@ -2,11 +2,11 @@
## Explanation of terms:
Remarks:
** Remarks** :
Operators' specifications must meet the remarks' requirements.
Broadcast rule:
** Broadcast rule** :
- per-layer:
@ -26,6 +26,30 @@ Broadcast rule:
@@ -26,6 +26,30 @@ Broadcast rule:
shape(A) = (2, 3, 4, 5), shape(B) = (5,) ==> shape(result) = (2, 3, 4, 5)
**Input Size Restrictions Description**
Assuming that input size is [N,H,W,C] (layout is NHWC)
- Case 1: the first layer is **Convolution** , whose kernel size is [kernel_height, kernel_width]
**W * kernel_height < 7168* *
**kernel_height * kernel_width < 128* *
- Case 2: first layer is not Convolution, and C == 1 or C == 3 or C == 4
**W < 7168 * *
- others:
**No Restrictions**
## ONNX OPs supported by RKNN Toolkit2
@ -33,63 +57,65 @@ According to [ONNX official instructions](https://github.com/microsoft/onnxrunti
@@ -33,63 +57,65 @@ According to [ONNX official instructions](https://github.com/microsoft/onnxrunti
The list of ONNX OPs supported by RKNN Toolkit2 is as follows:
| **Operators** | **Remarks** |
|-----------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| --------------------- | ------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Add | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > support broadcast rule: per-layer/channel/element |
| AveragePool | channel: [1, 8192]< br / > kernel height/width: [1, 7]< br / > stride height/width: [1, 8]< br / > pad left/right/top/bottom: [0, 7] |
| ArgMin ||
| ArgMax ||
| AveragePool | channel: [1, 8192]< br / > kernel height/width: [1, 7]< br / > stride height/width: [1, 8]< br / > pad left/right/top/bottom: [0, 7]< br / > auto_pad: NOTSET< br / > count_include_pad: 1 < br / > ceil_mode: 0 |
| ArgMin | |
| ArgMax | |
| BatchNormalization | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| cast | only support bool/int8/float |
| Clip | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Concat | axis: 1,2,3 |
| Conv | channel: unlimited < br / > kernel height/width: [1, 31]< br / > stride height/width: [1, 7]< br / > kernels: [1, 8184]< br / > pad left/right/top/bottom: [0, 15]< br / > dilation: [1, 31]< br / > group: unlimited |
| ConvTranspose | channel: unlimited < br / > kernel height/width: [1, 31]< br / > stride height/width: 2, 4, 8< br / > kernels: [1, 8192]< br / > pad left/right/top/bottom: [0, 15]< br / > dilation: [1, 31]< br / > group: unlimited |
| DepthToSpace ||
| Div | support broadcast rule: per-element/other |
| Elu ||
| Exp ||
| Flatten ||
| Gather ||
| Gemm | channel: unlimited < br / > One input should be Const |
| Concat | |
| Conv | channel: [0, 150000] < br / > kernel height/width: [1, 31]< br / > stride height/width: [1, 7]< br / > pad left/right/top/bottom: [0, 15] |
| ConvTranspose | channel: [0, 150000] < br / > kernel height/width: [1, 31]< br / > stride height/width: 2, 4, 8< br / > kernels: [1, 8192]< br / > pad left/right/top/bottom: [0, 15] |
| DepthToSpace | |
| Div | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8192]< br / > support broadcast rule: per-element/other |
| Elu | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > |
| Exp | |
| Flatten | |
| Gather | |
| Gemm | channel: [0, 150000] < br / > One input should be Const |
| GlobalAveragePool | channel: [1, 8192]< br / > kernel height/width: [1, 343]< br / > |
| GlobalMaxPool | channel: [1, 8192]< br / > kernel height/width: [1, 343]< br / > |
| Greater | support broadcast rule: per-element/other |
| HardSigmoid ||
| InstanceNormalization | |
| HardSwish | |
| LeakyRelu | channel: unlimited < br / > height: [1, 8192]< br / > width: [1, 8176] |
| HardSigmoid | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| HardSwish | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| InstanceNormalization | |
| LeakyRelu | channel: [1, 8192] < br / > height: [1, 8192]< br / > width: [1, 8176] |
| Less | support broadcast rule: per-element/other |
| LpNormalization ||
| LRN ||
| LSTM | batchsize: 1 |
| LpNormalization | |
| LRN | |
| LSTM | batchsize: 1< br / > input_forget: 0 |
| GRU | batchsize: 1 |
| MatMul | |
| Max | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > dims=4 |
| MaxPool | channel: [1, 8192]< br / > kernel height/width: [1, 7]< br / > stride height/width: [1, 8]< br / > pad left/right/top/bottom: [0, 7]< br / > auto_pad only support NOTSET,ceil_mode only support 0,unsupport dilations |
| MaxRoiPool ||
| Max | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| MaxPool | channel: [1, 8192]< br / > kernel height/width: [1, 7]< br / > stride height/width: [1, 8]< br / > pad left/right/top/bottom: [0, 7]< br / > auto_pad: NOTSET< br / > ceil_mode: 0< br / > dilations: unsupport< br / > storage_order: 0 |
| MaxRoiPool | |
| MaxUnpool | unsupport pad |
| Min | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Mul | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > support broadcast rule: per-layer/channel/element |
| Pad | pad value should >= 0; pad dims must be 2 when mode is reflect or edge |
| Pow ||
| PRelu | channel: unlimited < br / > height: [1, 8192]< br / > width: [1, 8176]< br / > slope support broadcast rule:: per-layer/channel |
| ReduceMax ||
| ReduceMean | output dims < = 4 |
| ReduceSum | output dims < = 4 |
| ReduceMin ||
| Pad | width: [1, 8176]< br / > mode: constant< br / > pads n_begin/n_end/c_begin/c_end: 1 |
| Pow | |
| PRelu | channel: [1, 8192] < br / > height: [1, 8192]< br / > width: [1, 8176]< br / > slope support broadcast rule: per-layer/channel |
| ReduceMax | |
| ReduceMean | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8192] |
| ReduceSum | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8192] |
| ReduceMin | |
| Relu | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Reshape ||
| Resize | bilinear(not support tf_crop_and_resize); nearest2d |
| ReverseSequence ||
| Reshape | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Resize | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > mode: nearest< br / > scales: [1, 8] |
| ReverseSequence | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > batch_axis: 1 < br / > time_axis: 0 |
| RoiAlign | pool type: average |
| Sigmoid ||
| Slice ||
| Softmax ||
| SpaceToDetph ||
| Split ||
| Squeeze ||
| Tanh | channel: unlimited< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Tile ||
| Transpose ||
| Sigmoid | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Slice | steps: 1 |
| Softmax | channel: [1, 8192]< br / > axis: 1 |
| SpaceToDetph | |
| Split | axis: 1(channel) |
| Sub | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > support broadcast rule: per-layer/channel/element |
| Squeeze | |
| Tanh | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Tile | |
| Transpose | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Upsample (resize) | coordinate_transformation_mode unsupport tf_crop_and_resize |
@ -100,37 +126,37 @@ The protocol based on the official revision of berkeley comes from [berkeley caf
@@ -100,37 +126,37 @@ The protocol based on the official revision of berkeley comes from [berkeley caf
Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 is as follows:
| **Operators** | **Remarks** |
|------------------------|----------------------- ----------------------------------------------------------------------------------------------------------------------|
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| BatchNorm | same as onnx BatchNormalization |
| bn (BatchNorm + Scale) | same as onnx BatchNormalization according to https://github.com/TimoSaemann/caffe-segnet-cudnn5 |
| BNLL ||
| BNLL | |
| Concat | same as onnx Concat |
| Convolution | same as onnx Conv |
| ConvolutionDepthwise | channel:unlimited< br / > kernel height/width: [1, 8]< br / > stride height/width: [1, 7] < br / > kernels: 1< br / > pad left/right/top/bottom: [0, 15] |
| Crop ||
| ConvolutionDepthwise | kernel height/width: [1, 8]< br / > kernels: 1 < br / > others same as onnx Conv |
| Crop | |
| Deconvolution | same as ConvTranspose |
| Dropout ||
| Dropout | |
| Eltwise | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176]< br / > support broadcast rule: per-layer/channel/element |
| Flatten ||
| HardSigmoid ||
| Flatten | |
| HardSigmoid | |
| InnerProduct | same as onnx Gemm |
| LRN | same as onnx LRN |
| Lstm | same as onnx LSTM according to https://github.com/xmfbit/warpctc-caffe |
| Normalize ||
| Normalize | |
| Permute | same as onnx Transpose |
| Power ||
| Power | |
| Pooling | same as onnx pooling |
| PRelu | same as onnx PRelu |
| Proposal | batch: 1 |
| Reduction | output dims < = 4 |
| Relu | same as onnx Relu |
| Relu6 | same as onnx Clip |
| Reorg ||
| Reorg | |
| Reshape | same as onnx Reshape |
| Resize | bilinear; nearest |
| Reverse ||
| Reverse | |
| ROIPooling | same as MaxRoiPool according to https://github.com/twmht/caffe-pva-faster-rcnn |
| Scale | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| Scale | same as onnx Mul |
| Sigmoid | same as onnx Sigmoid |
| Slice | same as onnx Split |
| Softmax | same as onnx Softmax |
@ -147,19 +173,19 @@ The Pytorch version supported by RKNN Toolkit2 is >1.6.0, models generated by ot
@@ -147,19 +173,19 @@ The Pytorch version supported by RKNN Toolkit2 is >1.6.0, models generated by ot
The list of Pytorch OPs supported by RKNN Toolkit2 is as follows:
| **Operators** | **Remarks** |
|---------------------------|------------------------------------ |
| ------------------------- | --------------------------------------------------------------- |
| aten::_convolution | same as onnx Conv |
| aten::add | same as onnx Add |
| aten::avg_pool2d | same as onnx AveragePool |
| aten::batch_norm | same as onnx BatchNormalization |
| aten::cat | same as onnx Concat |
| aten::chunk ||
| aten::dropout ||
| aten::chunk | |
| aten::dropout | |
| aten::elu | same as onnx Elu |
| aten::flatten ||
| aten::flatten | |
| aten::hardswish | same as onnx HardSwish |
| aten::instance_norm | same as onnx InstanceNormalization |
| aten::layer_norm ||
| aten::layer_norm | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8192] |
| aten::leaky_relu | same as onnx LeakyRelu |
| aten::linear | same as onnx Gemm |
| aten::matmul | same as onnx MatMul |
@ -188,53 +214,53 @@ The pb files (contain OPs belows) generated by TensorFlow version 1.12 - 1.15 fo
@@ -188,53 +214,53 @@ The pb files (contain OPs belows) generated by TensorFlow version 1.12 - 1.15 fo
The list of TensorFlow OPs supported by RKNN Toolkit2 is as follows:
| **Operators** | **Remarks** |
|-----------------------|-------------------------------------------------------------------- -------------------------------------------------------------------------|
| --------------------- | ------------------------------------------------------------------------- |
| Add | same as onnx Add |
| AvgPool | same as onnx AveragePool |
| Concat | same as onnx Concat |
| Conv2D | same as onnx Conv |
| DepthToSpace ||
| DepthwiseConv2d | channel:unlimited< br / > kernel height/width: [1, 8]< br / > stride height/width: [1, 7] < br / > kernels: 1< br / > pad left/right/top/bottom: [0, 15] |
| DepthToSpace | |
| DepthwiseConv2d | kernel height/width: [1, 8]< br / > kernels: 1 < br / > others same as onnx Conv |
| Div | same as onnx Div |
| Dropout ||
| Flatten ||
| Dropout | |
| Flatten | |
| LeakyRelu | same as onnx LeakyRelu |
| Less | same as onnx Less |
| LRN ||
| LRN | |
| MatMul | |
| MaxPool | same as onnx MaxPool |
| Mean | output dims < = 4 |
| Pad | same as onnx Pad |
| Relu | same as onnx Relu |
| Reshape ||
| ResizeBilinear ||
| ResizeNearestNeighbor ||
| Sigmoid ||
| Slice ||
| Softmax ||
| Softplus ||
| SpaceToDepth ||
| Split ||
| Squeeze ||
| StridedSlice ||
| Reshape | |
| ResizeBilinear | |
| ResizeNearestNeighbor | |
| Sigmoid | |
| Slice | |
| Softmax | |
| Softplus | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| SpaceToDepth | |
| Split | |
| Squeeze | |
| StridedSlice | |
| Tanh | same as onnx TanH |
| Transpose ||
| Transpose | |
## Darknet OPs supported by RKNN Toolkit2
The list of Darknet OPs supported by RKNN Toolkit2 is as follows:
| **Operators** | **Remarks** |
|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| add | same as onnx Add |
| batchnormalize | same as onnx BatchNormalization |
| concat | same as onnx Concat |
| convolutional | same as onnx Conv |
| depthwise_convolutional | channel:unlimited< br / > kernel height/width: [1, 8]< br / > stride height/width: [1, 7] < br / > kernels: 1< br / > pad left/right/top/bottom: [0, 15] |
| depthwise_convolutional | kernel height/width: [1, 8]< br / > kernels: 1 < br / > others same as onnx Conv |
| fullconnect | |
| leakyrelu | same as onnx LeakyRelu |
| mish ||
| pooling | **AveragePool** :< br /> channel: [1, 8192]< br /> kernel height/width: [1, 7]< br /> stride height/width: [1, 8]< br /> pad left/right/top/bottom: [0, 7]< br /> <br /> **GlobalAveragePool** :< br /> channel: [1, 8192]< br /> kernel height/width: [1, 128]< br /> stride height/width: [1, 8]< br /> pad left/right/top/bottom: [0, 7] < br /> < br /> **MaxPool/GlobalMaxPool** :< br /> channel: [1, 8192]< br /> kernel height/width: [1, 7]< br /> stride height/width: [1, 8]< br /> pad left/right/top/bottom: [0, 7]< br />< br /> MaxPool: < br /> auto_pad only support NOTSET,ceil_mode only support 0,unsupport dilations |
| route ||
| shortcut ||
| softmax ||
| upsampling ||
| mish | channel: [1, 8192]< br / > height: [1, 8192]< br / > width: [1, 8176] |
| pooling | **AveragePool** : same as onnx AveragePool < br /> **GlobalAveragePool** : same as onnx GlobalAveragePool < br /> **MaxPool/GlobalMaxPool** : same as onnx MaxPool/GlobalMaxPool |
| route | |
| shortcut | |
| softmax | |
| upsampling | |