[Quantization] Improve the usage of fastdeploy tools (#722)

Improve the usage of fastdeploy tools
This commit is contained in:
yunyaoXYY
2022-11-28 16:55:32 +08:00
committed by GitHub
parent 9ae5c24607
commit ae3487560d
10 changed files with 24 additions and 30 deletions

View File

@@ -46,12 +46,12 @@ wget https://bj.bcebos.com/paddlehub/fastdeploy/COCO_val_320.tar.gz
tar -xvf COCO_val_320.tar.gz
```
##### 2. Run fastdeploy --auto_compress command to compress the model
##### 2. Run fastdeploy compress command to compress the model
The following command is to quantize the yolov5s model, if developers want to quantize other models, replace the config_path with other model configuration files in the configs folder.
```shell
fastdeploy --auto_compress --config_path=./configs/detection/yolov5s_quant.yaml --method='PTQ' --save_dir='./yolov5s_ptq_model/'
fastdeploy compress --config_path=./configs/detection/yolov5s_quant.yaml --method='PTQ' --save_dir='./yolov5s_ptq_model/'
```
[notice] PTQ is short for post-training quantization
@@ -83,14 +83,14 @@ wget https://bj.bcebos.com/paddlehub/fastdeploy/COCO_val_320.tar.gz
tar -xvf COCO_val_320.tar.gz
```
##### 2.Use fastdeploy --auto_compress command to compress models
##### 2.Use fastdeploy compress command to compress models
The following command is to quantize the yolov5s model, if developers want to quantize other models, replace the config_path with other model configuration files in the configs folder.
```shell
# Please specify the single card GPU before training, otherwise it may get stuck during the training process.
export CUDA_VISIBLE_DEVICES=0
fastdeploy --auto_compress --config_path=./configs/detection/yolov5s_quant.yaml --method='QAT' --save_dir='./yolov5s_qat_model/'
fastdeploy compress --config_path=./configs/detection/yolov5s_quant.yaml --method='QAT' --save_dir='./yolov5s_qat_model/'
```
##### 3.Parameters