mathmanu / caffe-jacinto

This repository has moved. The new link can be obtained from https://github.com/TexasInstruments/jacinto-ai-devkit
116 stars 35 forks source link

how to use quantization #26

Open ghost opened 5 years ago

ghost commented 5 years ago

where can I find quantization scripts for model inference? thanks

mathmanu commented 5 years ago

The inference script is here: https://github.com/tidsp/caffe-jacinto-models/blob/caffe-0.17/scripts/infer_cityscapes_segmentation.sh

Example prototxts with quantization are in: trained/image_segmentation/cityscapes5_jsegnet21v2/test_quantize

All you have to do is add quantize: true to your prototxt file.

Not that this is a simulation of qunatization to measure the accuracy with quantization and not the actual fixed point inference.

mathmanu commented 5 years ago

You may also want to merge the batch norm weights to convolution weights using caffe optimize command before running the inference with quantization.