From 077111ef1c6e6fcd06659fae42757a0505cffe52 Mon Sep 17 00:00:00 2001 From: dongshuilong Date: Wed, 28 Jul 2021 12:43:27 +0000 Subject: [PATCH] fix slim bugs --- deploy/slim/README.md | 6 +++--- deploy/slim/README_en.md | 6 +++--- log/endpoints.log | 5 +++++ ppcls/configs/slim/ResNet50_vd_quantization.yaml | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 log/endpoints.log diff --git a/deploy/slim/README.md b/deploy/slim/README.md index f5b0bf0e..335b915b 100644 --- a/deploy/slim/README.md +++ b/deploy/slim/README.md @@ -66,7 +66,7 @@ cd PaddleClas 以CPU为例,若使用GPU,则将命令中改成`cpu`改成`gpu` ```bash -python3.7 deploy/slim/slim.py -m train -c ppcls/configs/slim/ResNet50_vd_quantalization.yaml -o Global.device=cpu +python3.7 deploy/slim/slim.py -m train -c ppcls/configs/slim/ResNet50_vd_quantization.yaml -o Global.device=cpu ``` 其中`yaml`文件解析详见[参考文档](../../docs/zh_CN/tutorials/config_description.md)。为了保证精度,`yaml`文件中已经使用`pretrained model`. @@ -81,7 +81,7 @@ python3.7 -m paddle.distributed.launch \ --gpus="0,1,2,3" \ deploy/slim/slim.py \ -m train \ - -c ppcls/configs/slim/ResNet50_vd_quantalization.yaml + -c ppcls/configs/slim/ResNet50_vd_quantization.yaml ``` ##### 3.1.2 离线量化 @@ -131,7 +131,7 @@ python3.7 -m paddle.distributed.launch \ python3.7 deploy/slim/slim.py \ -m export \ -c ppcls/configs/slim/ResNet50_vd_prune.yaml \ - -o Global.save_inference_dir=./inference + -o Global.save_inference_dir=./inference ``` diff --git a/deploy/slim/README_en.md b/deploy/slim/README_en.md index dce48192..815dbc10 100644 --- a/deploy/slim/README_en.md +++ b/deploy/slim/README_en.md @@ -67,7 +67,7 @@ The training command is as follow: If using GPU, change the `cpu` to `gpu` in the following command. ```bash -python3.7 deploy/slim/slim.py -m train -c ppcls/configs/slim/ResNet50_vd_quantalization.yaml -o Global.device=cpu +python3.7 deploy/slim/slim.py -m train -c ppcls/configs/slim/ResNet50_vd_quantization.yaml -o Global.device=cpu ``` The description of `yaml` file can be found in this [doc](../../docs/en/tutorials/config_en.md). To get better accuracy, the `pretrained model`is used in `yaml`. @@ -82,7 +82,7 @@ python3.7 -m paddle.distributed.launch \ --gpus="0,1,2,3" \ deploy/slim/slim.py \ -m train \ - -c ppcls/configs/slim/ResNet50_vd_quantalization.yaml + -c ppcls/configs/slim/ResNet50_vd_quantization.yaml ``` ##### 3.1.2 Offline quantization @@ -132,7 +132,7 @@ After getting the compressed model, we can export it as inference model for pred python3.7 deploy/slim/slim.py \ -m export \ -c ppcls/configs/slim/ResNet50_vd_prune.yaml \ - -o Global.save_inference_dir=./inference + -o Global.save_inference_dir=./inference ``` ### 5. Deploy diff --git a/log/endpoints.log b/log/endpoints.log new file mode 100644 index 00000000..438da7f1 --- /dev/null +++ b/log/endpoints.log @@ -0,0 +1,5 @@ +PADDLE_TRAINER_ENDPOINTS: +127.0.0.1:51466 +127.0.0.1:58283 +127.0.0.1:34005 +127.0.0.1:58331 \ No newline at end of file diff --git a/ppcls/configs/slim/ResNet50_vd_quantization.yaml b/ppcls/configs/slim/ResNet50_vd_quantization.yaml index 41fcd0c8..aeccaeaa 100644 --- a/ppcls/configs/slim/ResNet50_vd_quantization.yaml +++ b/ppcls/configs/slim/ResNet50_vd_quantization.yaml @@ -42,7 +42,7 @@ Optimizer: momentum: 0.9 lr: name: Cosine - learning_rate: 0.1 + learning_rate: 0.01 regularizer: name: 'L2' coeff: 0.00007 -- GitLab