Skip to content

use ncnnoptimize to optimize model

wiki-sync-bot edited this page Oct 15, 2024 · 1 revision

the typical usage

ncnnoptimize mobilenet.param mobilenet.bin mobilenet-opt.param mobilenet-opt.bin 65536 

operator fusion

  • batchnorm - scale
  • convolution - batchnorm
  • convolutiondepthwise - batchnorm
  • deconvolution - batchnorm
  • deconvolutiondepthwise - batchnorm
  • innerproduct - batchnorm
  • convolution - relu
  • convolutiondepthwise - relu
  • deconvolution - relu
  • deconvolutiondepthwise - relu
  • innerproduct - relu

eliminate noop operator

  • innerproduct - dropout
  • flatten after global pooling

prefer better operator

  • replace convolution with innerproduct after global pooling
Clone this wiki locally