run_post_training_quanzation.sh 616 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
export CUDA_VISIBLE_DEVICES=0

root_url="https://paddle-inference-dist.bj.bcebos.com/int8"
mobilenetv1="mobilenetv1_fp32_model"
samples="samples_100"
if [ ! -d ${mobilenetv1} ]; then
    wget ${root_url}/${mobilenetv1}.tgz
    tar zxf ${mobilenetv1}.tgz
fi
if [ ! -d ${samples} ]; then
    wget ${root_url}/${samples}.tgz
    tar zxf ${samples}.tgz
fi

python post_training_quantization.py \
    --model_dir=${mobilenetv1} \
    --data_path=${samples} \
    --save_model_path="mobilenetv1_int8_model" \
    --algo="KL" \
    --is_full_quantize=True \
    --batch_size=10 \
    --batch_nums=10 \
    --use_gpu=True \