From 5287ee8b26732a6ef2332fecc83b918a4c2ad153 Mon Sep 17 00:00:00 2001 From: Tingquan Gao Date: Tue, 15 Dec 2020 12:17:28 +0800 Subject: [PATCH] [Release/2.0 rc1] Fix some description of documentations (#474) * Fix serial number error * Fix the environment description of running PaddleClas * Add the overview of other models * Modify the pretrained models to dygraph --- README.md | 20 +++++++++++++++++++ README_cn.md | 19 ++++++++++++++++++ .../MobileNetV3_large_x1_0_finetune.yaml | 1 - .../R50_vd_distill_MV3_large_x1_0.yaml | 5 +---- configs/quick_start/ResNet50_vd.yaml | 1 - configs/quick_start/ResNet50_vd_finetune.yaml | 1 - .../ResNet50_vd_ssld_finetune.yaml | 1 - ...Net50_vd_ssld_random_erasing_finetune.yaml | 1 - docs/en/tutorials/install_en.md | 3 ++- docs/en/tutorials/quick_start_en.md | 14 ++++++------- docs/zh_CN/tutorials/install.md | 5 +++-- docs/zh_CN/tutorials/quick_start.md | 16 +++++++-------- 12 files changed, 58 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 75d156bd..a424f9e9 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ PaddleClas is a toolset for image classification tasks prepared for the industry - [Inception series](#Inception_series) - [EfficientNet and ResNeXt101_wsl series](#EfficientNet_and_ResNeXt101_wsl_series) - [ResNeSt and RegNet series](#ResNeSt_and_RegNet_series) + - [Others](#Others) - HS-ResNet: arxiv link: [https://arxiv.org/pdf/2010.07621.pdf](https://arxiv.org/pdf/2010.07621.pdf). Code and models are coming soon! - Model training/evaluation - [Data preparation](./docs/en/tutorials/data_en.md) @@ -315,6 +316,25 @@ Accuracy and inference time metrics of ResNeSt and RegNet series models are show | RegNetX_4GF | 0.785 | 0.9416 | 6.46478 | 11.19862 | 8 | 22.1 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/RegNetX_4GF_pretrained.pdparams) | + + +### Others + +Accuracy and inference time metrics of AlexNet, SqueezeNet series, VGG series and DarkNet53 models are shown as follows. More detailed information can be refered to [Others](./docs/en/models/Others_en.md). + + +| Model | Top-1 Acc | Top-5 Acc | time(ms)
bs=1 | time(ms)
bs=4 | Flops(G) | Params(M) | Download Address | +|------------------------|-----------|-----------|------------------|------------------|----------|-----------|------------------------------------------------------------------------------------------------------| +| AlexNet | 0.567 | 0.792 | 1.44993 | 2.46696 | 1.370 | 61.090 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/AlexNet_pretrained.pdparams) | +| SqueezeNet1_0 | 0.596 | 0.817 | 0.96736 | 2.53221 | 1.550 | 1.240 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/SqueezeNet1_0_pretrained.pdparams) | +| SqueezeNet1_1 | 0.601 | 0.819 | 0.76032 | 1.877 | 0.690 | 1.230 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/SqueezeNet1_1_pretrained.pdparams) | +| VGG11 | 0.693 | 0.891 | 3.90412 | 9.51147 | 15.090 | 132.850 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG11_pretrained.pdparams) | +| VGG13 | 0.700 | 0.894 | 4.64684 | 12.61558 | 22.480 | 133.030 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG13_pretrained.pdparams) | +| VGG16 | 0.720 | 0.907 | 5.61769 | 16.40064 | 30.810 | 138.340 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG16_pretrained.pdparams) | +| VGG19 | 0.726 | 0.909 | 6.65221 | 20.4334 | 39.130 | 143.650 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG19_pretrained.pdparams) | +| DarkNet53 | 0.780 | 0.941 | 4.10829 | 12.1714 | 18.580 | 41.600 | [Download link](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/DarkNet53_pretrained.pdparams) | + + ## License diff --git a/README_cn.md b/README_cn.md index 5d11380c..89fbeea9 100644 --- a/README_cn.md +++ b/README_cn.md @@ -67,6 +67,7 @@ - [Inception系列](#Inception系列) - [EfficientNet与ResNeXt101_wsl系列](#EfficientNet与ResNeXt101_wsl系列) - [ResNeSt与RegNet系列](#ResNeSt与RegNet系列) + - [其他模型](#其他模型) - HS-ResNet: arxiv文章链接: [https://arxiv.org/pdf/2010.07621.pdf](https://arxiv.org/pdf/2010.07621.pdf)。 代码和预训练模型即将开源,敬请期待。 - 模型训练/评估 - [数据准备](./docs/zh_CN/tutorials/data.md) @@ -317,8 +318,26 @@ ResNeSt与RegNet系列模型的精度、速度指标如下表所示,更多关 | ResNeSt50 | 0.8083 | 0.9542 | 6.69042 | 8.01664 | 10.78 | 27.5 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNeSt50_pretrained.pdparams) | | RegNetX_4GF | 0.785 | 0.9416 | 6.46478 | 11.19862 | 8 | 22.1 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/RegNetX_4GF_pretrained.pdparams) | + + +### 其他模型 + +关于AlexNet、SqueezeNet系列、VGG系列、DarkNet53等模型的精度、速度指标如下表所示,更多介绍可以参考:[其他模型文档](./docs/zh_CN/models/Others.md)。 + + +| 模型 | Top-1 Acc | Top-5 Acc | time(ms)
bs=1 | time(ms)
bs=4 | Flops(G) | Params(M) | 下载地址 | +|------------------------|-----------|-----------|------------------|------------------|----------|-----------|------------------------------------------------------------------------------------------------------| +| AlexNet | 0.567 | 0.792 | 1.44993 | 2.46696 | 1.370 | 61.090 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/AlexNet_pretrained.pdparams) | +| SqueezeNet1_0 | 0.596 | 0.817 | 0.96736 | 2.53221 | 1.550 | 1.240 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/SqueezeNet1_0_pretrained.pdparams) | +| SqueezeNet1_1 | 0.601 | 0.819 | 0.76032 | 1.877 | 0.690 | 1.230 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/SqueezeNet1_1_pretrained.pdparams) | +| VGG11 | 0.693 | 0.891 | 3.90412 | 9.51147 | 15.090 | 132.850 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG11_pretrained.pdparams) | +| VGG13 | 0.700 | 0.894 | 4.64684 | 12.61558 | 22.480 | 133.030 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG13_pretrained.pdparams) | +| VGG16 | 0.720 | 0.907 | 5.61769 | 16.40064 | 30.810 | 138.340 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG16_pretrained.pdparams) | +| VGG19 | 0.726 | 0.909 | 6.65221 | 20.4334 | 39.130 | 143.650 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/VGG19_pretrained.pdparams) | +| DarkNet53 | 0.780 | 0.941 | 4.10829 | 12.1714 | 18.580 | 41.600 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/DarkNet53_pretrained.pdparams) | + ## 许可证书 本项目的发布受Apache 2.0 license许可认证。 diff --git a/configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml b/configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml index dc47e226..827029b7 100644 --- a/configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml +++ b/configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml @@ -2,7 +2,6 @@ mode: 'train' ARCHITECTURE: name: 'MobileNetV3_large_x1_0' pretrained_model: "./pretrained/MobileNetV3_large_x1_0_pretrained" -load_static_weights: True model_save_dir: "./output/" classes_num: 102 total_images: 1020 diff --git a/configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml b/configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml index 3e483821..2ece6eba 100644 --- a/configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml +++ b/configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml @@ -4,10 +4,7 @@ ARCHITECTURE: pretrained_model: - "./pretrained/flowers102_R50_vd_final/ppcls" - - "./pretrained/MobileNetV3_large_x1_0_pretrained/" -load_static_weights: - - False - - True + - "./pretrained/MobileNetV3_large_x1_0_pretrained" model_save_dir: "./output/" classes_num: 102 total_images: 7169 diff --git a/configs/quick_start/ResNet50_vd.yaml b/configs/quick_start/ResNet50_vd.yaml index 76e4d316..40befb57 100644 --- a/configs/quick_start/ResNet50_vd.yaml +++ b/configs/quick_start/ResNet50_vd.yaml @@ -4,7 +4,6 @@ ARCHITECTURE: checkpoints: "" pretrained_model: "" -load_static_weights: True model_save_dir: "./output/" classes_num: 102 total_images: 1020 diff --git a/configs/quick_start/ResNet50_vd_finetune.yaml b/configs/quick_start/ResNet50_vd_finetune.yaml index 1aa6b19e..415e0e80 100644 --- a/configs/quick_start/ResNet50_vd_finetune.yaml +++ b/configs/quick_start/ResNet50_vd_finetune.yaml @@ -2,7 +2,6 @@ mode: 'train' ARCHITECTURE: name: 'ResNet50_vd' pretrained_model: "./pretrained/ResNet50_vd_pretrained" -load_static_weights: true model_save_dir: "./output/" classes_num: 102 total_images: 1020 diff --git a/configs/quick_start/ResNet50_vd_ssld_finetune.yaml b/configs/quick_start/ResNet50_vd_ssld_finetune.yaml index 511dff00..d6bf8634 100644 --- a/configs/quick_start/ResNet50_vd_ssld_finetune.yaml +++ b/configs/quick_start/ResNet50_vd_ssld_finetune.yaml @@ -4,7 +4,6 @@ ARCHITECTURE: params: lr_mult_list: [0.1, 0.1, 0.2, 0.2, 0.3] pretrained_model: "./pretrained/ResNet50_vd_ssld_pretrained" -load_static_weights: True model_save_dir: "./output/" classes_num: 102 total_images: 1020 diff --git a/configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml b/configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml index 019a05b4..0019908f 100644 --- a/configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml +++ b/configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml @@ -4,7 +4,6 @@ ARCHITECTURE: params: lr_mult_list: [0.1, 0.1, 0.2, 0.2, 0.3] pretrained_model: "./pretrained/ResNet50_vd_ssld_pretrained" -load_static_weights: True model_save_dir: "./output/" classes_num: 102 total_images: 1020 diff --git a/docs/en/tutorials/install_en.md b/docs/en/tutorials/install_en.md index 157b0143..f97194c1 100644 --- a/docs/en/tutorials/install_en.md +++ b/docs/en/tutorials/install_en.md @@ -8,7 +8,7 @@ This document introduces how to install PaddleClas and its requirements. ## Install PaddlePaddle -Python 3.6, CUDA 9.0, CUDNN7.0 nccl2.1.2 and later version are required at first, For now, PaddleClas only support training on the GPU device. Please follow the instructions in the [Installation](http://www.paddlepaddle.org.cn/install/quick) if the PaddlePaddle on the device is lower than v1.7 +Python 3.6, CUDA 9.0, CUDNN7.6.4 nccl2.1.2 and later version are required at first, For now, PaddleClas only support training on the GPU device. Please follow the instructions in the [Installation](http://www.paddlepaddle.org.cn/install/quick) if the PaddlePaddle on the device is lower than v1.7 Install PaddlePaddle @@ -34,6 +34,7 @@ python -c "import paddle; print(paddle.__version__)" Note: - Make sure the compiled version is later than PaddlePaddle2.0rc. - Indicate **WITH_DISTRIBUTE=ON** when compiling, Please refer to [Instruction](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#id3) for more details. +- When running in docker, in order to ensure that the container has enough shared memory for data read acceleration of Paddle, please set the parameter `--shm_size=8g` at creating a docker container, if conditions permit, you can set it to a larger value. ## Install PaddleClas diff --git a/docs/en/tutorials/quick_start_en.md b/docs/en/tutorials/quick_start_en.md index adf115ab..719587b8 100644 --- a/docs/en/tutorials/quick_start_en.md +++ b/docs/en/tutorials/quick_start_en.md @@ -47,16 +47,14 @@ You can use the following commands to downdload the pretrained models. ```bash mkdir pretrained cd pretrained -wget https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_pretrained.tar -wget https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_ssld_pretrained.tar -wget https://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV3_large_x1_0_pretrained.tar -tar -xf ResNet50_vd_pretrained.tar -tar -xf ResNet50_vd_ssld_pretrained.tar -tar -xf MobileNetV3_large_x1_0_pretrained.tar +wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_pretrained.pdparams +wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams +wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x1_0_pretrained.pdparams + cd ../ ``` -**Note**: If you want to download the pretrained models on Windows environment, you can copy the links to the browser and download, then use the the thirdparty tools such as `7Zip` to uncompress the tar files. +**Note**: If you want to download the pretrained models on Windows environment, you can copy the links to the browser and download. ## Training @@ -165,7 +163,7 @@ cp -r output/ResNet50_vd/19/ ./pretrained/flowers102_R50_vd_final/ ### Distillation -* Use extra_list.txt as unlabeled data, Note: +* Use `extra_list.txt` as unlabeled data, Note: * Samples in the `extra_list.txt` and `val_list.txt` don't have intersection * Because of in the source code, label information is unused, This is still unlabeled distillation * Teacher model use the pretrained_model trained on the flowers102 dataset, and student model use the MobileNetV3_large_x1_0 pretrained model(Acc 75.32\%) trained on the ImageNet1K dataset diff --git a/docs/zh_CN/tutorials/install.md b/docs/zh_CN/tutorials/install.md index a971b032..d8e41067 100644 --- a/docs/zh_CN/tutorials/install.md +++ b/docs/zh_CN/tutorials/install.md @@ -34,13 +34,14 @@ python -c "import paddle; print(paddle.__version__)" 注意: - 从源码编译的PaddlePaddle版本号为0.0.0,请确保使用了PaddlePaddle 2.0rc及之后的源码编译。 -- PaddleClas基于PaddlePaddle高性能的分布式训练能力,若您从源码编译,请确保打开编译选项,**WITH_DISTRIBUTE=ON**。具体编译选项参考[编译选项表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#id3) +- PaddleClas基于PaddlePaddle高性能的分布式训练能力,若您从源码编译,请确保打开编译选项,**WITH_DISTRIBUTE=ON**。具体编译选项参考[编译选项表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#id3)。 +- 在docker中运行时,为保证docker容器有足够的共享内存用于Paddle的数据读取加速,在创建docker容器时,请设置参数`--shm_size=8g`,条件允许的话可以设置为更大的值。 **运行环境需求:** - Python3 (当前只支持Linux系统) - CUDA >= 9.0 -- cuDNN >= 5.0 +- cuDNN >= 7.6.4 - nccl >= 2.1.2 diff --git a/docs/zh_CN/tutorials/quick_start.md b/docs/zh_CN/tutorials/quick_start.md index a5f6c427..5c88bd0c 100644 --- a/docs/zh_CN/tutorials/quick_start.md +++ b/docs/zh_CN/tutorials/quick_start.md @@ -47,16 +47,14 @@ cd ../../ ```bash mkdir pretrained cd pretrained -wget https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_pretrained.tar -wget https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_ssld_pretrained.tar -wget https://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV3_large_x1_0_pretrained.tar -tar -xf ResNet50_vd_pretrained.tar -tar -xf ResNet50_vd_ssld_pretrained.tar -tar -xf MobileNetV3_large_x1_0_pretrained.tar +wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_pretrained.pdparams +wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams +wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x1_0_pretrained.pdparams + cd ../ ``` -**注意**:如果是在windows中下载预训练模型的话,需要将地址拷贝到浏览器中并下载,然后使用`7Zip`等工具进行解压。 +**注意**:如果是在windows中下载预训练模型的话,需要将地址拷贝到浏览器中下载。 ### 2.2 环境说明 @@ -164,7 +162,7 @@ cp -r output/ResNet50_vd/best_model/ ./pretrained/flowers102_R50_vd_final/ ### 3.6 知识蒸馏小试牛刀 -* 使用flowers102数据集进行模型蒸馏,为了进一步提提升模型的精度,使用extra_list.txt充当无标签数据,在这里有几点需要注意: +* 使用flowers102数据集进行模型蒸馏,为了进一步提提升模型的精度,使用`extra_list.txt`充当无标签数据,在这里有几点需要注意: * `extra_list.txt`与`val_list.txt`的样本没有重复,因此可以用于扩充知识蒸馏任务的训练数据。 * 即使引入了有标签的extra_list.txt中的图像,但是代码中没有使用标签信息,因此仍然可以视为无标签的模型蒸馏。 * 蒸馏过程中,教师模型使用的预训练模型为flowers102数据集上的训练结果,学生模型使用的是ImageNet1k数据集上精度为75.32\%的MobileNetV3_large_x1_0预训练模型。 @@ -196,7 +194,7 @@ python -m paddle.distributed.launch \ 最终flowers102验证集上的精度为0.9647,结合更多的无标签数据,使用教师模型进行知识蒸馏,MobileNetV3的精度涨幅高达6.47\%。 -### 3.6 精度一览 +### 3.7 精度一览 * 下表给出了不同训练yaml文件对应的精度。 -- GitLab