# RepVGG
<!--- Guideline: please use url linked to the paper abstract in ArXiv instead of PDF for fast loading. -->
> [RepVGG: Making VGG-style ConvNets Great Again](https://arxiv.org/abs/2101.03697)
## Introduction
<!--- Guideline: Introduce the model and architectures. Please cite if you use/adopt paper explanation from others. -->
<!--- Guideline: If an architecture table/figure is available in the paper, please put one here and cite for intuitive illustration. -->
The key idea of Repvgg is that by using re-parameterization, the model architecture could be trained in multi-branch but validated in single branch.
Figure 1 shows the basic model architecture of Repvgg. By utilizing different values for a and b, we could get various repvgg models.
Repvgg could achieve better model performance with smaller model parameters on ImageNet-1K dataset compared with previous methods.[[1](#references)]
<p align="center">
<img src="https://user-images.githubusercontent.com/77485245/226785860-e109b0ea-eb6b-4464-91a9-8898b3e3e056.png" width=400 />
</p>
<p align="center">
<em>Figure 1. Architecture of Repvgg [<a href="#references">1</a>] </em>
</p>
## Results
<!--- Guideline:
Table Format:
- Model: model name in lower case with _ seperator.
- Context: Training context denoted as {device}x{pieces}-{MS mode}, where mindspore mode can be G - graph mode or F - pynative mode with ms function. For example, D910x8-G is for training on 8 pieces of Ascend 910 NPU using graph mode.
- Top-1 and Top-5: Keep 2 digits after the decimal point.
- Params (M): # of model parameters in millions (10^6). Keep 2 digits after the decimal point
- Recipe: Training recipe/configuration linked to a yaml config file. Use absolute url path.
- Download: url of the pretrained model weights. Use absolute url path.
-->
Our reproduced model performance on ImageNet-1K is reported as follows.
<div align="center">
| Model | Context | Top-1 (%) | Top-5 (%) | Params (M) | Recipe | Download |
|-----------|-----------|-----------|-----------|------------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| repvgg_a0 | D910x8-G | 72.19 | 90.75 | 9.13 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a0_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a0-6e71139d.ckpt) |
| repvgg_a1 | D910x8-G | 74.19 | 91.89 | 14.12 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a1_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a1-539513ac.ckpt) |
| repvgg_a2 | D910x8-G | 76.63 | 93.42 | 28.25 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a2_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a2-cdc90b11.ckpt) |
| repvgg_b0 | D910x8-G | 74.99 | 92.40 | 15.85 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b0_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b0-54d5862c.ckpt) |
| repvgg_b1 | D910x8-G | 78.81 | 94.37 | 57.48 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b1_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b1-4673797.ckpt) |
| repvgg_b2 | D910x64-G | 79.29 | 94.66 | 89.11 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b2_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b2-7c91ccd4.ckpt) |
| repvgg_b3 | D910x64-G | 80.46 | 95.34 | 123.19 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b3_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b3-30b35f52.ckpt) |
</div>
#### Notes
- Context: Training context denoted as {device}x{pieces}-{MS mode}, where mindspore mode can be G - graph mode or F - pynative mode with ms function. For example, D910x8-G is for training on 8 pieces of Ascend 910 NPU using graph mode.
- Top-1 and Top-5: Accuracy reported on the validation set of ImageNet-1K.
## Quick Start
### Preparation
#### Installation
Please refer to the [installation instruction](https://github.com/mindspore-lab/mindcv#installation) in MindCV.
#### Dataset Preparation
Please download the [ImageNet-1K](https://www.image-net.org/challenges/LSVRC/2012/index.php) dataset for model training and validation.
### Training
<!--- Guideline: Please avoid using shell scripts in the command line. Python scripts preferred. -->
* Distributed Training
It is easy to reproduce the reported results with the pre-defined training recipe. For distributed training on multiple Ascend 910 devices, please run
```shell
# distributed training on multiple GPU/Ascend devices
mpirun -n 8 python train.py --config configs/repvgg/repvgg_a1_ascend.yaml --data_dir /path/to/imagenet
```
> If the script is executed by the root user, the `--allow-run-as-root` parameter must be added to `mpirun`.
Similarly, you can train the model on multiple GPU devices with the above `mpirun` command.
For detailed illustration of all hyper-parameters, please refer to [config.py](https://github.com/mindspore-lab/mindcv/blob/main/config.py).
**Note:** As the global batch size (batch_size x num_devices) is an important hyper-parameter, it is recommended to keep the global batch size unchanged for reproduction or adjust the learning rate linearly to a new global batch size.
* Standalone Training
If you want to train or finetune the model on a smaller dataset without distributed training, please run:
```shell
# standalone training on a CPU/GPU/Ascend device
python train.py --config configs/repvgg/repvgg_a1_ascend.yaml --data_dir /path/to/dataset --distribute False
```
### Validation
To validate the accuracy of the trained model, you can use `validate.py` and parse the checkpoint path with `--ckpt_path`.
```
python validate.py -c configs/repvgg/repvgg_a1_ascend.yaml --data_dir /path/to/imagenet --ckpt_path /path/to/ckpt
```
### Deployment
Please refer to the [deployment tutorial](https://github.com/mindspore-lab/mindcv/blob/main/tutorials/deployment.md) in MindCV.
## References
<!--- Guideline: Citation format GB/T 7714 is suggested. -->
[1] Ding X, Zhang X, Ma N, et al. Repvgg: Making vgg-style convnets great again[C]//Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2021: 13733-13742.
没有合适的资源?快使用搜索试试~ 我知道了~
MindCV是一个基于 MindSpore 开发的,致力于计算机视觉相关技术研发的开源工具箱
共409个文件
yaml:150个
py:130个
md:80个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 86 浏览量
2023-06-20
10:11:05
上传
评论
收藏 1.46MB ZIP 举报
温馨提示
MindCV是一个基于 MindSpore 开发的,致力于计算机视觉相关技术研发的开源工具箱。它提供大量的计算机视觉领域的经典模型和SoTA模型以及它们的预训练权重和训练策略。同时,还提供了自动增强等SoTA算法来提高模型性能。通过解耦的模块设计,您可以轻松地将MindCV应用到您自己的CV任务中。基于MindCV进行模型实现和重训练的汇总结果详见benchmark_results.md, 所用到的训练策略和训练后的模型权重均可通过表中链接获取。
资源推荐
资源详情
资源评论
收起资源包目录
MindCV是一个基于 MindSpore 开发的,致力于计算机视觉相关技术研发的开源工具箱 (409个子文件)
make.bat 760B
make.bat 760B
docutils.conf 43B
docutils.conf 43B
readthedocs.css 41B
readthedocs.css 41B
.flake8 169B
.gitattributes 726B
.gitignore 2KB
layout.html 13KB
theme_variables.jinja 3KB
dog.jpg 33KB
Makefile 634B
Makefile 634B
benchmark_results.md 32KB
quick_start.md 21KB
quick_start_CN.md 19KB
finetune.md 17KB
finetune_CN.md 16KB
model_template.md 11KB
LICENSE.md 11KB
model_template_CN.md 10KB
learn_about_config.md 10KB
learn_about_config_CN.md 10KB
deployment.md 7KB
README.md 7KB
README.md 7KB
README.md 6KB
deployment_CN.md 6KB
README.md 6KB
README.md 6KB
README.md 6KB
README.md 6KB
README.md 6KB
README.md 6KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
CONTRIBUTING.md 5KB
README.md 5KB
inference.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
inference_CN.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 5KB
README.md 4KB
README.md 4KB
README.md 4KB
README.md 4KB
README.md 4KB
README.md 4KB
README.md 4KB
README.md 4KB
RELEASE.md 2KB
bug_report.md 1KB
feature.md 1KB
feature_CN.md 1KB
README.md 813B
PULL_REQUEST_TEMPLATE.md 758B
feature_request.md 743B
definition.md 448B
README.md 446B
README.md 442B
definition_CN.md 410B
switch_language.md 141B
switch_language.md 141B
README.md 61B
faq_CN.md 35B
contribute.md 34B
changelog_CN.md 32B
contribute_CN.md 32B
changelog.md 26B
faq.md 21B
output_11_0.png 412KB
output_23_0.png 136KB
output_30_0.png 131KB
output_8_0.png 101KB
cat_and_dog.png 88KB
logo.png 15KB
共 409 条
- 1
- 2
- 3
- 4
- 5
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 7361
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功