Browse Source

update rknn-toolkit2 to 1.0.0

Signed-off-by: Randall Zhuo <randall.zhuo@rock-chips.com>
Change-Id: I48fa3ee1f450bcb3412f456107805f556b2ed717
pull/53/head
Randall Zhuo 4 years ago
parent
commit
44b64209e8
  1. 40
      doc/RKNNToolKit2_OP_Support_v1.0.0.md
  2. BIN
      doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v0.7.0.pdf
  3. BIN
      doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf
  4. BIN
      doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v0.7.0.pdf
  5. BIN
      doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf
  6. BIN
      doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v0.7.0.pdf
  7. BIN
      doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf
  8. BIN
      doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v0.7.0.pdf
  9. BIN
      doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf
  10. 21
      doc/changelog_v1.0.0.txt
  11. 0
      doc/requirements_v1.0.0.txt
  12. 3
      examples/caffe/mobilenet_v2/test.py
  13. 3
      examples/caffe/vgg-ssd/test.py
  14. 6
      examples/darknet/yolov3_416x416/test.py
  15. 0
      examples/load_quantized_model/README.md
  16. 0
      examples/load_quantized_model/goldfish_299x299.jpg
  17. 2
      examples/load_quantized_model/test.py
  18. 2
      examples/onnx/resnet50v2/test.py
  19. 2
      examples/pytorch/resnet18/test.py
  20. 2
      examples/tensorflow/ssd_mobilenet_v1/test.py
  21. 4
      examples/tflite/mobilenet_v1/test.py
  22. 4
      examples/tflite/mobilenet_v1_quant/test.py
  23. BIN
      packages/rknn_toolkit2-1.0.0-cp36-cp36m-linux_x86_64.whl

40
doc/RKNNToolKit2_OP_Support-v0.7.0.md → doc/RKNNToolKit2_OP_Support_v1.0.0.md

@ -38,25 +38,26 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version @@ -38,25 +38,26 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version
| **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|
| BNLL ||
| 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 />|
| 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 ||
| 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]|
| BNLL ||
| 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 />|
| 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 ||
| 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 ||
| Eltwise |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />support broadcast rule: per-layer/channel/element|
| Flatten ||
| InnerProduct |channel: [1, 8192]|
| LRN ||
| Normalize |dims: 4|
| InnerProduct |channel: [1, 8192]|
| LRN ||
| Normalize ||
| 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|
| Proposal |batch: 1|
| Reduction |output dims <= 4|
| Proposal |batch: 1|
| Reduction |output dims <= 4|
| Relu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Relu6 |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Reorg ||
@ -66,10 +67,11 @@ Based on this protocol, the list of Caffe OPs supported by RKNN Toolkit2 Version @@ -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|
| Scale |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 ||
| Split ||
| TanH |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Tile ||
| Transpose ||
| 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: @@ -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|
| 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 ||
| Div |support broadcast rule: per-element/other|
| Div |support broadcast rule: per-element/other|
| Flatten ||
| 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]|
| 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|
| HardSigmoid ||
| LeakyRelu |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Less |support broadcast rule: per-element/other|
| LpNormalization |dims: 4|
| LpNormalization ||
| LRN ||
| 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 ||
| MaxUnpool |unsupport pad|
| 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: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]<br />slope support broadcast rule:: per-layer/channel|
| ReduceMean |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: @@ -118,6 +123,7 @@ The list of ONNX OPs supported by RKNN Toolkit2 Version 0.6.0 is as follows:
| Split ||
| Squeeze ||
| Tanh |channel: [1, 8192]<br />height: [1, 8192]<br />width: [1, 8176]|
| Tile ||
| Transpose ||
| Upsample (resize) || |

BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v0.7.0.pdf

Binary file not shown.

BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_CN_v1.0.0.pdf

Binary file not shown.

BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v0.7.0.pdf

Binary file not shown.

BIN
doc/Rockchip_Quick_Start_RKNN_Toolkit2_EN_v1.0.0.pdf

Binary file not shown.

BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v0.7.0.pdf

Binary file not shown.

BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_CN_v1.0.0.pdf

Binary file not shown.

BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v0.7.0.pdf

Binary file not shown.

BIN
doc/Rockchip_User_Guide_RKNN_Toolkit2_EN_v1.0.0.pdf

Binary file not shown.

21
doc/changelog-v0.7.0.txt → doc/changelog_v1.0.0.txt

@ -1,3 +1,24 @@ @@ -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
版本:v0.7.0
更新内容:

0
doc/requirements-v0.7.0.txt → doc/requirements_v1.0.0.txt

3
examples/caffe/mobilenet_v2/test.py

@ -26,7 +26,7 @@ if __name__ == '__main__': @@ -26,7 +26,7 @@ if __name__ == '__main__':
# pre-process config
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')
# Load tensorflow model
@ -57,7 +57,6 @@ if __name__ == '__main__': @@ -57,7 +57,6 @@ if __name__ == '__main__':
# Set inputs
img = cv2.imread('./goldfish_224x224.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
print('--> Init runtime environment')
ret = rknn.init_runtime()

3
examples/caffe/vgg-ssd/test.py

@ -160,7 +160,7 @@ if __name__ == '__main__': @@ -160,7 +160,7 @@ if __name__ == '__main__':
# pre-process config
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')
# Load tensorflow model
@ -191,7 +191,6 @@ if __name__ == '__main__': @@ -191,7 +191,6 @@ if __name__ == '__main__':
# Set inputs
img = cv2.imread('./road_300x300.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
print('--> Init runtime environment')
ret = rknn.init_runtime()

6
examples/darknet/yolov3_416x416/test.py

@ -26,7 +26,7 @@ if __name__ == '__main__': @@ -26,7 +26,7 @@ if __name__ == '__main__':
# pre-process config
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')
# Load tensorflow model
@ -91,8 +91,8 @@ if __name__ == '__main__': @@ -91,8 +91,8 @@ if __name__ == '__main__':
if boxes is not None:
draw(image, boxes, scores, classes)
cv2.imshow("results", image)
cv2.waitKeyEx(0)
print('Save results to results.jpg!')
cv2.imwrite('results.jpg', image)
rknn.release()

0
examples/common_function_demos/load_quantized_model/README.md → examples/load_quantized_model/README.md

0
examples/common_function_demos/load_quantized_model/goldfish_299x299.jpg → examples/load_quantized_model/goldfish_299x299.jpg

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

2
examples/common_function_demos/load_quantized_model/test.py → examples/load_quantized_model/test.py

@ -101,7 +101,7 @@ if __name__ == '__main__': @@ -101,7 +101,7 @@ if __name__ == '__main__':
print('done')
# pre-process config
print('--> Config model')
rknn.config(reorder_channel=False)
rknn.config()
print('done')
# Load tensorflow model

2
examples/onnx/resnet50v2/test.py

@ -80,7 +80,7 @@ if __name__ == '__main__': @@ -80,7 +80,7 @@ if __name__ == '__main__':
print('done')
# 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')
# Load model

2
examples/pytorch/resnet18/test.py

@ -50,7 +50,7 @@ if __name__ == '__main__': @@ -50,7 +50,7 @@ if __name__ == '__main__':
# pre-process config
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')
# Load pytorch model

2
examples/tensorflow/ssd_mobilenet_v1/test.py

@ -60,7 +60,7 @@ if __name__ == '__main__': @@ -60,7 +60,7 @@ if __name__ == '__main__':
rknn = RKNN()
# 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
print('--> Loading model')

4
examples/tflite/mobilenet_v1/test.py

@ -24,11 +24,11 @@ def show_outputs(outputs): @@ -24,11 +24,11 @@ def show_outputs(outputs):
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN(verbose=True)
rknn = RKNN()
# pre-process config
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')
# Load tensorflow model

4
examples/tflite/mobilenet_v1_quant/test.py

@ -24,11 +24,11 @@ def show_outputs(outputs): @@ -24,11 +24,11 @@ def show_outputs(outputs):
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN(verbose=True)
rknn = RKNN()
# pre-process config
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')
# Load tensorflow model

BIN
packages/rknn_toolkit2-0.7.0-cp36-cp36m-linux_x86_64.whl → packages/rknn_toolkit2-1.0.0-cp36-cp36m-linux_x86_64.whl

Binary file not shown.
Loading…
Cancel
Save