From 2e14f726d05cfb2416c7312dd36332723bf9007e Mon Sep 17 00:00:00 2001 From: dongshuilong Date: Thu, 15 Apr 2021 17:15:18 +0800 Subject: [PATCH] fix mixnet review problems --- README.md | 2 +- README_cn.md | 2 +- docs/en/update_history_en.md | 2 +- docs/zh_CN/update_history.md | 2 +- ppcls/modeling/architectures/mixnet.py | 37 +++----------------------- 5 files changed, 7 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index ec66ccba..2ffb92c9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ PaddleClas is a toolset for image classification tasks prepared for the industry and academia. It helps users train better computer vision models and apply them in real scenarios. **Recent update** -- 2021.04.15 Add `MixNet` and `ReXNet` pretrained models, `MixNet`'s Top-1 Acc on ImageNet-1k reaches 78.6% and `ReXNet` reaches 82.09%. +- 2021.04.15 Add `MixNet` and `ReXNet` pretrained models, `MixNet_L`'s Top-1 Acc on ImageNet-1k reaches 78.6% and `ReXNet_3_0` reaches 82.09%. - 2021.03.02 Add support for model quantization. - 2021.02.01 Add `RepVGG` pretrained models, whose Top-1 Acc on ImageNet-1k dataset reaches 79.65%. - 2021.01.27 Add `ViT` and `DeiT` pretrained models, `ViT`'s Top-1 Acc on ImageNet-1k dataset reaches 85.13%, and `DeiT` reaches 85.1%. diff --git a/README_cn.md b/README_cn.md index a0f87700..a0513dc7 100644 --- a/README_cn.md +++ b/README_cn.md @@ -8,7 +8,7 @@ **近期更新** -- 2021.04.15 添加`MixNet`和`ReXNet`系列模型,在ImageNet-1k上`MixNet` 模型Top1 Acc可达78.6%,`ReXNet`模型可达82.09% +- 2021.04.15 添加`MixNet`和`ReXNet`系列模型,在ImageNet-1k上`MixNet_L` 模型Top1 Acc可达78.6%,`ReXNet_3_0`模型可达82.09% - 2021.03.02 添加分类模型量化方法与使用教程。 - 2021.02.01 添加`RepVGG`系列模型,在ImageNet-1k上Top-1 Acc可达79.65%。 - 2021.01.27 添加`ViT`与`DeiT`模型,在ImageNet-1k上,`ViT`模型Top-1 Acc可达85.13%,`DeiT`模型可达85.1%。 diff --git a/docs/en/update_history_en.md b/docs/en/update_history_en.md index f045bcff..cef5384e 100644 --- a/docs/en/update_history_en.md +++ b/docs/en/update_history_en.md @@ -3,7 +3,7 @@ - 2021.04.15 - - Add `MixNet` and `ReXNet` pretrained models, `MixNet`'s Top-1 Acc on ImageNet-1k reaches 78.6% and `ReXNet` reaches 82.09%. + - Add `MixNet` and `ReXNet` pretrained models, `MixNet_L`'s Top-1 Acc on ImageNet-1k reaches 78.6% and `ReXNet_3_0` reaches 82.09%. - 2021.01.27 * Add ViT and DeiT pretrained models, ViT's Top-1 Acc on ImageNet reaches 81.05%, and DeiT reaches 85.5%. - 2021.01.08 diff --git a/docs/zh_CN/update_history.md b/docs/zh_CN/update_history.md index 23d853e2..89f7b146 100644 --- a/docs/zh_CN/update_history.md +++ b/docs/zh_CN/update_history.md @@ -3,7 +3,7 @@ - 2021.04.15 - - 添加`MixNet`和`ReXNet`系列模型,在ImageNet-1k上`MixNet` 模型Top1 Acc可达78.6%,`ReXNet`模型可达82.09% + - 添加`MixNet_L`和`ReXNet_3_0`系列模型,在ImageNet-1k上`MixNet` 模型Top1 Acc可达78.6%,`ReXNet`模型可达82.09% - 2021.01.27 * 添加ViT与DeiT模型,在ImageNet上,ViT模型Top-1 Acc可达81.05%,DeiT模型可达85.5%。 - 2021.01.08 diff --git a/ppcls/modeling/architectures/mixnet.py b/ppcls/modeling/architectures/mixnet.py index 0cdcecc5..f1956947 100644 --- a/ppcls/modeling/architectures/mixnet.py +++ b/ppcls/modeling/architectures/mixnet.py @@ -438,8 +438,7 @@ class MixUnit(nn.Layer): in_channels : int Number of input channels. out_channels : int - Number of output channels. - exp_channels : int + Number of output channels. exp_channels : int Number of middle (expanded) channels. stride : int or tuple/list of 2 int Strides of the second convolution layer. @@ -692,12 +691,7 @@ class MixNet(nn.Layer): return x -def get_mixnet(version, - width_scale, - model_name=None, - pretrained=False, - root=os.path.join("~", ".paddle", "models"), - **kwargs): +def get_mixnet(version, width_scale, model_name=None, **kwargs): """ Create MixNet model with specific parameters. @@ -708,11 +702,7 @@ def get_mixnet(version, width_scale : float Scale factor for width of layers. model_name : str or None, default None - Model name for loading pretrained model. - pretrained : bool, default False - Whether to load the pretrained weights for model. - root : str, default '~/.torch/models' - Location for keeping the model parameters. + Model name. """ if version == "s": @@ -769,13 +759,6 @@ def MixNet_S(**kwargs): """ MixNet-S model from 'MixConv: Mixed Depthwise Convolutional Kernels,' https://arxiv.org/abs/1907.09595. - - Parameters: - ---------- - pretrained : bool, default False - Whether to load the pretrained weights for model. - root : str, default '~/.torch/models' - Location for keeping the model parameters. """ return get_mixnet( version="s", width_scale=1.0, model_name="MixNet_S", **kwargs) @@ -785,13 +768,6 @@ def MixNet_M(**kwargs): """ MixNet-M model from 'MixConv: Mixed Depthwise Convolutional Kernels,' https://arxiv.org/abs/1907.09595. - - Parameters: - ---------- - pretrained : bool, default False - Whether to load the pretrained weights for model. - root : str, default '~/.torch/models' - Location for keeping the model parameters. """ return get_mixnet( version="m", width_scale=1.0, model_name="MixNet_M", **kwargs) @@ -801,13 +777,6 @@ def MixNet_L(**kwargs): """ MixNet-L model from 'MixConv: Mixed Depthwise Convolutional Kernels,' https://arxiv.org/abs/1907.09595. - - Parameters: - ---------- - pretrained : bool, default False - Whether to load the pretrained weights for model. - root : str, default '~/.torch/models' - Location for keeping the model parameters. """ return get_mixnet( version="m", width_scale=1.3, model_name="MixNet_L", **kwargs) -- GitLab