You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.0 kB

123456789101112131415161718192021222324252627282930
  1. # Post Training Quantization Tools
  2. To support int8 model deployment on mobile devices,we provide the universal post training quantization tools which can convert the float32 model to int8 model.
  3. The old convert tool and technical detail is in [Caffe-Int8-Convert-Tools](https://github.com/BUG1989/caffe-int8-convert-tools)
  4. ## User Guide
  5. Example with mobilenet,just need three steps.
  6. ### 1. Optimization graphic
  7. ```
  8. ./ncnnoptimize mobilenet-fp32.param mobilenet-fp32.bin mobilenet-nobn-fp32.param mobilenet-nobn-fp32.bin
  9. ```
  10. ### 2. Create the calibration table file
  11. We suggest that using the verification dataset for calibration, which is more than 5000 images.
  12. ```
  13. ./ncnn2table --param mobilenet-nobn-fp32.param --bin mobilenet-nobn-fp32.bin --images images/ --output mobilenet-nobn.table --mean 104,117,123 --norm 0.017,0.017,0.017 --size 224,224 --thread 2
  14. ```
  15. ### 3. Quantization
  16. ```
  17. ./ncnn2int8 mobilenet-nobn-fp32.param mobilenet-nobn-fp32.bin mobilenet-int8.param mobilenet-int8.bin mobilenet-nobn.table
  18. ```