update rknn-toolkit2 to 1.0.0
Signed-off-by: Randall Zhuo <randall.zhuo@rock-chips.com> Change-Id: I48fa3ee1f450bcb3412f456107805f556b2ed717
This commit is contained in:
parent
a4d3223144
commit
44b64209e8
@ -38,25 +38,26 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version
|
|||||||
|
|
||||||
| **Operators** | **Remarks** |
|
| **Operators** | **Remarks** |
|
||||||
| -------------------- | ----------- |
|
| -------------------- | ----------- |
|
||||||
| BatchNorm |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| BatchNorm |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
| bn (BatchNorm + Scale) |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br /> according to https://github.com/TimoSaemann/caffe-segnet-cudnn5|
|
| bn (BatchNorm + Scale) |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br /> according to https://github.com/TimoSaemann/caffe-segnet-cudnn5|
|
||||||
| BNLL ||
|
| BNLL ||
|
||||||
| Concat |axis: 1,2,3|
|
| Concat |axis: 1,2,3|
|
||||||
| Convolution |channel: [1, 8192]<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 />group: 1, channel / N <br /><br />|
|
| Convolution |channel: [1, 8192]<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 />group: 1, channel / N <br /><br />|
|
||||||
| ConvolutionDepthwise |channel:[1, 8192]<br />kernel height/width: [1, 8]<br />stride height/width: [1, 7]<br />kernels: 1<br />pad left/right/top/bottom: [0, 15]|
|
| ConvolutionDepthwise|channel:[1, 8192]<br />kernel height/width: [1, 8]<br />stride height/width: [1, 7]<br />kernels: 1<br />pad left/right/top/bottom: [0, 15]|
|
||||||
| Crop ||
|
| Crop ||
|
||||||
| Deconvolution |channel: [1, 8192]<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]|
|
| Deconvolution |channel: [1, 8192]<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]|
|
||||||
| Dropout ||
|
| Dropout ||
|
||||||
| Eltwise |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />support broadcast rule: per-layer/channel/element|
|
| Eltwise |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />support broadcast rule: per-layer/channel/element|
|
||||||
| Flatten ||
|
| Flatten ||
|
||||||
| InnerProduct |channel: [1, 8192]|
|
| InnerProduct |channel: [1, 8192]|
|
||||||
| LRN ||
|
| LRN ||
|
||||||
| Normalize |dims: 4|
|
| Normalize ||
|
||||||
| Permute ||
|
| Permute ||
|
||||||
| 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 |
|
| Power ||
|
||||||
|
| 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 |
|
||||||
| PRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />slope: per-layer/channel|
|
| PRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />slope: per-layer/channel|
|
||||||
| Proposal |batch: 1|
|
| Proposal |batch: 1|
|
||||||
| Reduction |output dims <= 4|
|
| Reduction |output dims <= 4|
|
||||||
| Relu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| Relu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
| Relu6 |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| Relu6 |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
| Reorg ||
|
| Reorg ||
|
||||||
@ -66,10 +67,11 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version
|
|||||||
| ROIPooling |according to https://github.com/twmht/caffe-pva-faster-rcnn|
|
| ROIPooling |according to https://github.com/twmht/caffe-pva-faster-rcnn|
|
||||||
| Scale |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| Scale |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
| Sigmoid |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| Sigmoid |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
| Slice ||
|
| Slice ||
|
||||||
| Softmax ||
|
| Softmax ||
|
||||||
| Split ||
|
| Split ||
|
||||||
| TanH |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| TanH |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
|
| Tile ||
|
||||||
| Transpose ||
|
| Transpose ||
|
||||||
| Upsample |according to https://github.com/SeanQ88/caffe_upsample and https://github.com/TimoSaemann/caffe-segnet-cudnn5|
|
| Upsample |according to https://github.com/SeanQ88/caffe_upsample and https://github.com/TimoSaemann/caffe-segnet-cudnn5|
|
||||||
|
|
||||||
@ -88,22 +90,25 @@ The list of ONNX OPs supported by RKNN Toolkit2 Version 0.6.0 is as follows:
|
|||||||
| Conv |channel: [1, 8192]<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: 1, channel / N|
|
| Conv |channel: [1, 8192]<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: 1, channel / N|
|
||||||
| ConvTranspose |channel: [1, 8192]<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: 1, channel / N|
|
| ConvTranspose |channel: [1, 8192]<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: 1, channel / N|
|
||||||
| DepthToSpace ||
|
| DepthToSpace ||
|
||||||
| Div |support broadcast rule: per-element/other|
|
| Div |support broadcast rule: per-element/other|
|
||||||
| Flatten ||
|
| Flatten ||
|
||||||
| Gemm |channel: [1, 8192]<br /> One input should be Const|
|
| Gemm |channel: [1, 8192]<br /> One input should be Const|
|
||||||
| GlobalAveragePool |channel: [1, 8192]<br />kernel height/width: [1, 128]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]|
|
| GlobalAveragePool |channel: [1, 8192]<br />kernel height/width: [1, 128]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]|
|
||||||
| GlobalMaxPool |channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]|
|
| GlobalMaxPool |channel: [1, 8192]<br />kernel height/width: [1, 7]<br />stride height/width: [1, 8]<br />pad left/right/top/bottom: [0, 7]|
|
||||||
| Greater |support broadcast rule: per-element/other|
|
| Greater |support broadcast rule: per-element/other|
|
||||||
|
| HardSigmoid ||
|
||||||
| LeakyRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| LeakyRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
| Less |support broadcast rule: per-element/other|
|
| Less |support broadcast rule: per-element/other|
|
||||||
| LpNormalization |dims: 4|
|
| LpNormalization ||
|
||||||
| LRN ||
|
| LRN ||
|
||||||
| MatMul |channel: [1, 8192]<br />dims: 2|
|
| MatMul |channel: [1, 8192]<br />dims: 2|
|
||||||
| 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|
|
| 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 ||
|
| MaxRoiPool ||
|
||||||
| MaxUnpool |unsupport pad|
|
| MaxUnpool |unsupport pad|
|
||||||
| Mul |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />support broadcast rule: per-layer/channel/element|
|
| 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|
|
| Pad |pad value should >= 0; pad dims must be 2 when mode is reflect or edge|
|
||||||
|
| Pow ||
|
||||||
| PRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />slope support broadcast rule:: per-layer/channel|
|
| PRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />slope support broadcast rule:: per-layer/channel|
|
||||||
| ReduceMean |output dims <= 4|
|
| ReduceMean |output dims <= 4|
|
||||||
| ReduceSum |output dims <= 4|
|
| ReduceSum |output dims <= 4|
|
||||||
@ -118,6 +123,7 @@ The list of ONNX OPs supported by RKNN Toolkit2 Version 0.6.0 is as follows:
|
|||||||
| Split ||
|
| Split ||
|
||||||
| Squeeze ||
|
| Squeeze ||
|
||||||
| Tanh |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
| Tanh |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
|
||||||
|
| Tile ||
|
||||||
| Transpose ||
|
| Transpose ||
|
||||||
| Upsample (resize) || |
|
| Upsample (resize) || |
|
||||||
|
|
||||||
Binary file not shown.
BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf
Normal file
BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf
Normal file
BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf
Normal file
BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf
Normal file
BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf
Normal file
Binary file not shown.
@ -1,3 +1,24 @@
|
|||||||
|
2021-4-30
|
||||||
|
版本:v1.0.0
|
||||||
|
更新内容:
|
||||||
|
1. 新功能:
|
||||||
|
1)卷积类的per channel量化功能
|
||||||
|
2)添加了config中custom_string的模型信息设置、img_quant_RGB2BGR设置
|
||||||
|
3)添加了eval performance的性能测试接口
|
||||||
|
4)添加了连板调试功能
|
||||||
|
2. OP支持:
|
||||||
|
1) 添加了Caffe新OP支持:Power/Tile/Eltwise(Max)/去除了normalize维度的限制
|
||||||
|
2) 添加了onnx新OP支持:HardSigmoid/Pow/Tile
|
||||||
|
3. 修复一些已知的bug:
|
||||||
|
1) 修复了caffe FC的输出shape以及name的错误
|
||||||
|
2) 优化了mmse的量化性能
|
||||||
|
3)修复caffe的Pooling层的输出shape计算错误
|
||||||
|
4)修复了caffe slice丢弃了其中一个输出的inference bug
|
||||||
|
5)修复了caffe scale层的计算错误
|
||||||
|
4. 弃置了reorder_channel的config设置,由用户自行保证inference输入数据的channel正确性
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2021-4-2
|
2021-4-2
|
||||||
版本:v0.7.0
|
版本:v0.7.0
|
||||||
更新内容:
|
更新内容:
|
||||||
@ -26,7 +26,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> config model')
|
print('--> config model')
|
||||||
rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[58.82, 58.82, 58.82], reorder_channel=True)
|
rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[58.82, 58.82, 58.82], quant_img_RGB2BGR=True)
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load tensorflow model
|
# Load tensorflow model
|
||||||
@ -57,7 +57,6 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# Set inputs
|
# Set inputs
|
||||||
img = cv2.imread('./goldfish_224x224.jpg')
|
img = cv2.imread('./goldfish_224x224.jpg')
|
||||||
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
|
||||||
|
|
||||||
print('--> Init runtime environment')
|
print('--> Init runtime environment')
|
||||||
ret = rknn.init_runtime()
|
ret = rknn.init_runtime()
|
||||||
|
|||||||
@ -160,7 +160,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> config model')
|
print('--> config model')
|
||||||
rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[1, 1, 1], reorder_channel=True)
|
rknn.config(mean_values=[103.94, 116.78, 123.68], std_values=[1, 1, 1], quant_img_RGB2BGR=True)
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load tensorflow model
|
# Load tensorflow model
|
||||||
@ -191,7 +191,6 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# Set inputs
|
# Set inputs
|
||||||
img = cv2.imread('./road_300x300.jpg')
|
img = cv2.imread('./road_300x300.jpg')
|
||||||
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
|
||||||
|
|
||||||
print('--> Init runtime environment')
|
print('--> Init runtime environment')
|
||||||
ret = rknn.init_runtime()
|
ret = rknn.init_runtime()
|
||||||
|
|||||||
@ -26,7 +26,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> config model')
|
print('--> config model')
|
||||||
rknn.config(mean_values=[0, 0, 0], std_values=[255, 255, 255], reorder_channel=False)
|
rknn.config(mean_values=[0, 0, 0], std_values=[255, 255, 255])
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load tensorflow model
|
# Load tensorflow model
|
||||||
@ -91,8 +91,8 @@ if __name__ == '__main__':
|
|||||||
if boxes is not None:
|
if boxes is not None:
|
||||||
draw(image, boxes, scores, classes)
|
draw(image, boxes, scores, classes)
|
||||||
|
|
||||||
cv2.imshow("results", image)
|
print('Save results to results.jpg!')
|
||||||
cv2.waitKeyEx(0)
|
cv2.imwrite('results.jpg', image)
|
||||||
|
|
||||||
rknn.release()
|
rknn.release()
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
@ -101,7 +101,7 @@ if __name__ == '__main__':
|
|||||||
print('done')
|
print('done')
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> Config model')
|
print('--> Config model')
|
||||||
rknn.config(reorder_channel=False)
|
rknn.config()
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load tensorflow model
|
# Load tensorflow model
|
||||||
@ -80,7 +80,7 @@ if __name__ == '__main__':
|
|||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# print('--> config model')
|
# print('--> config model')
|
||||||
rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.82, 58.82, 58.82], reorder_channel=False)
|
rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.82, 58.82, 58.82])
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load model
|
# Load model
|
||||||
|
|||||||
@ -50,7 +50,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> config model')
|
print('--> config model')
|
||||||
rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.395, 58.395, 58.395], reorder_channel=False)
|
rknn.config(mean_values=[123.675, 116.28, 103.53], std_values=[58.395, 58.395, 58.395])
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load pytorch model
|
# Load pytorch model
|
||||||
|
|||||||
@ -60,7 +60,7 @@ if __name__ == '__main__':
|
|||||||
rknn = RKNN()
|
rknn = RKNN()
|
||||||
|
|
||||||
# Config for Model Input PreProcess
|
# Config for Model Input PreProcess
|
||||||
rknn.config(mean_values=[127.5, 127.5, 127.5], std_values=[127.5, 127.5, 127.5], reorder_channel=False)
|
rknn.config(mean_values=[127.5, 127.5, 127.5], std_values=[127.5, 127.5, 127.5])
|
||||||
|
|
||||||
# Load TensorFlow Model
|
# Load TensorFlow Model
|
||||||
print('--> Loading model')
|
print('--> Loading model')
|
||||||
|
|||||||
@ -24,11 +24,11 @@ def show_outputs(outputs):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# Create RKNN object
|
# Create RKNN object
|
||||||
rknn = RKNN(verbose=True)
|
rknn = RKNN()
|
||||||
|
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> config model')
|
print('--> config model')
|
||||||
rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128], reorder_channel=False)
|
rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128])
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load tensorflow model
|
# Load tensorflow model
|
||||||
|
|||||||
@ -24,11 +24,11 @@ def show_outputs(outputs):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# Create RKNN object
|
# Create RKNN object
|
||||||
rknn = RKNN(verbose=True)
|
rknn = RKNN()
|
||||||
|
|
||||||
# pre-process config
|
# pre-process config
|
||||||
print('--> config model')
|
print('--> config model')
|
||||||
rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128], reorder_channel=False)
|
rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128])
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
# Load tensorflow model
|
# Load tensorflow model
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user