diff --git a/docs/en/faq_en.md b/docs/en/faq_en.md index e006870bfaacef21bbadc6aaade496557c52180f..6f34117fd46ac4db24c4c369e41a3e11ce835a9a 100644 --- a/docs/en/faq_en.md +++ b/docs/en/faq_en.md @@ -45,7 +45,15 @@ VALID: >> * Q: What should I do if I want to transform the weights' format from `pdparams` to an earlier version(before Paddle1.7.0), which consists of the scattered files? -* A: You can use `fluid.load` to load the `pdparams` weights and use `fluid.io.save_vars` to save the weights as scattered files. +* A: You can use `fluid.load` to load the `pdparams` weights and use `fluid.io.save_vars` to save the weights as scattered files. The demo is as follows. Finally all the scattered files will be saved in the path `path_to_save_var`. +``` +fluid.load( + program=infer_prog, model_path=args.pretrained_model, executor=exe) +state = fluid.io.load_program_state(args.pretrained_model) +def exists(var): + return var.name in state +fluid.io.save_vars(exe, "./path_to_save_var", infer_prog, predicate=exists) +``` >> diff --git a/docs/en/models/ResNeSt_RegNet_en.md b/docs/en/models/ResNeSt_RegNet_en.md index ad1dad1766940bb9e6d98451711b6fb6706cf5a1..4332a8179958deaa34052475ac840ade3a115b16 100644 --- a/docs/en/models/ResNeSt_RegNet_en.md +++ b/docs/en/models/ResNeSt_RegNet_en.md @@ -2,9 +2,12 @@ The ResNeSt series was proposed in 2020. The original resnet network structure has been improved by introducing K groups and adding an attention module similar to SEBlock in different groups, the accuracy is greater than that of the basic model ResNet, but the parameter amount and flops are almost the same as the basic ResNet. +RegNet was proposed in 2020 by FAIR to deepen the concept of design space. Based on AnyNetX, the model performance is gradually improved by shared bottleneck ratio, shared group width, adjusting network depth or width and other strategies. What's more, the design space structure is simplified, whose interpretability is also be improved. The quality of design space is improved while its diversity is maintained. Under similar conditions, the performance of the designed RegNet model performs better than EfficientNet and 5 times faster than EfficientNet. + ## Accuracy, FLOPs and Parameters | Models | Top1 | Top5 | Reference
top1 | Reference
top5 | FLOPS
(G) | Parameters
(M) | |:--:|:--:|:--:|:--:|:--:|:--:|:--:| | ResNeSt50_fast_1s1x64d | 0.8035 | 0.9528| 0.8035 | -| 8.68 | 26.3 | | ResNeSt50 | 0.8102 | 0.9542| 0.8113 | -| 10.78 | 27.5 | +| RegNetX_4GF | 0.7850 | 0.9416| 0.7860 | -| 8.0 | 22.1 | diff --git a/docs/en/models/models_intro_en.md b/docs/en/models/models_intro_en.md index 72cecd805f13cd2668f00be599b3653af49b3d9b..fa3518506f78f472f46c2f4f167802e307d5973b 100644 --- a/docs/en/models/models_intro_en.md +++ b/docs/en/models/models_intro_en.md @@ -196,6 +196,9 @@ python tools/infer/predict.py \ - ResNeSt series[[24](#ref24)]([paper link](https://arxiv.org/abs/2004.08955)) - [ResNeSt50_fast_1s1x64d](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_fast_1s1x64d_pretrained.pdparams) - [ResNeSt50](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_pretrained.pdparams) + - RegNet series[[25](#ref25)]([paper link](https://arxiv.org/abs/2003.13678)) + - [RegNetX_4GF](https://paddle-imagenet-models-name.bj.bcebos.com/RegNetX_4GF_pretrained.pdparams) + - Other models @@ -270,3 +273,5 @@ python tools/infer/predict.py \ [23] Han K, Wang Y, Tian Q, et al. GhostNet: More features from cheap operations[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 1580-1589. [24] Zhang H, Wu C, Zhang Z, et al. Resnest: Split-attention networks[J]. arXiv preprint arXiv:2004.08955, 2020. + +[25] Radosavovic I, Kosaraju R P, Girshick R, et al. Designing network design spaces[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 10428-10436. diff --git a/docs/zh_CN/faq.md b/docs/zh_CN/faq.md index dd73b674a113c93a444f76134ccaf20cda0e9db8..bd5401475e9be71a91adc3738dd27ff6a42d4191 100644 --- a/docs/zh_CN/faq.md +++ b/docs/zh_CN/faq.md @@ -45,7 +45,15 @@ VALID: >> * Q: 如果想将保存的`pdparams`模型参数文件转换为早期版本(Paddle1.7.0之前)的零碎文件(每个文件均为一个单独的模型参数),该怎么实现呢? -* A: 可以首先导入`pdparams`模型,之后使用`fluid.io.save_vars`函数将模型保存为零散的碎文件。 +* A: 可以首先导入`pdparams`模型,之后使用`fluid.io.save_vars`函数将模型保存为零散的碎文件。示例代码如下,最终所有零散文件会被保存在`path_to_save_var`目录下。 +``` +fluid.load( + program=infer_prog, model_path=args.pretrained_model, executor=exe) +state = fluid.io.load_program_state(args.pretrained_model) +def exists(var): + return var.name in state +fluid.io.save_vars(exe, "./path_to_save_var", infer_prog, predicate=exists) +``` >> diff --git a/docs/zh_CN/models/ResNeSt_RegNet.md b/docs/zh_CN/models/ResNeSt_RegNet.md index 10b1e589615e35a101b03865d90539157b24f08c..e18c823dccb92dcc29dc027e32b61b4b1cc9c45e 100644 --- a/docs/zh_CN/models/ResNeSt_RegNet.md +++ b/docs/zh_CN/models/ResNeSt_RegNet.md @@ -4,6 +4,8 @@ ResNeSt系列模型是在2020年提出的,在原有的resnet网络结构上做了改进,通过引入K个Group和在不同Group中加入类似于SEBlock的attention模块,使得精度相比于基础模型ResNet有了大幅度的提高,且参数量和flops与基础的ResNet基本保持一致。 +RegNet是由FAIR于2020年提出,旨在深化设计空间理念的概念,在AnyNetX的基础上逐步改进,通过加入共享瓶颈ratio、共享组宽度、调整网络深度与宽度等策略,最终实现简化设计空间结构、提高设计空间的可解释性、改善设计空间的质量,并保持设计空间的模型多样性的目的。最终设计出的模型在类似的条件下,性能还要由于EfficientNet,并且在GPU上的速度提高了5倍。 + ## 精度、FLOPS和参数量 @@ -11,3 +13,4 @@ ResNeSt系列模型是在2020年提出的,在原有的resnet网络结构上做 |:--:|:--:|:--:|:--:|:--:|:--:|:--:| | ResNeSt50_fast_1s1x64d | 0.8035 | 0.9528| 0.8035 | -| 8.68 | 26.3 | | ResNeSt50 | 0.8102 | 0.9542| 0.8113 | -| 10.78 | 27.5 | +| RegNetX_4GF | 0.7850 | 0.9416| 0.7860 | -| 8.0 | 22.1 | diff --git a/docs/zh_CN/models/models_intro.md b/docs/zh_CN/models/models_intro.md index 7faa7c0f0389f577d084418b1e49e3723985b32a..514cbdace29a062a4fac3e3685dfdc05082c97b6 100644 --- a/docs/zh_CN/models/models_intro.md +++ b/docs/zh_CN/models/models_intro.md @@ -192,8 +192,10 @@ python tools/infer/predict.py \ - ResNeSt与RegNet系列 - ResNeSt系列[[24](#ref24)]([论文地址](https://arxiv.org/abs/2004.08955)) - - [ResNeSt50_fast_1s1x64d)(https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_fast_1s1x64d_pretrained.pdparams) - - [ResNeSt50)(https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_pretrained.pdparams) + - [ResNeSt50_fast_1s1x64d](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_fast_1s1x64d_pretrained.pdparams) + - [ResNeSt50](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_pretrained.pdparams) + - RegNet系列[[25](#ref25)]([paper link](https://arxiv.org/abs/2003.13678)) + - [RegNetX_4GF](https://paddle-imagenet-models-name.bj.bcebos.com/RegNetX_4GF_pretrained.pdparams) - 其他模型 @@ -268,3 +270,5 @@ python tools/infer/predict.py \ [23] Han K, Wang Y, Tian Q, et al. GhostNet: More features from cheap operations[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 1580-1589. [24] Zhang H, Wu C, Zhang Z, et al. Resnest: Split-attention networks[J]. arXiv preprint arXiv:2004.08955, 2020. + +[25] Radosavovic I, Kosaraju R P, Girshick R, et al. Designing network design spaces[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 10428-10436.