From c9f8e8c6e7fec4ca05fad901e1c87a3b42b70ff3 Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Thu, 5 Nov 2020 17:22:33 +0800 Subject: [PATCH] fix config (#371) * fix config doc * fix mainpage link * fix typo --- README.md | 1 + README_cn.md | 3 +-- docs/en/tutorials/config_en.md | 20 ++++++++++++++++---- docs/zh_CN/tutorials/config.md | 23 ++++++++++++++++++----- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1091d77a..1e738a5f 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ PaddleClas is a toolset for image classification tasks prepared for the industry - [Data preparation](./docs/en/tutorials/data_en.md) - [Model training and finetuning](./docs/en/tutorials/getting_started_en.md) - [Model evaluation](./docs/en/tutorials/getting_started_en.md) + - [Configuration details](./docs/en/tutorials/config_en.md) - Model prediction/inference - [Prediction based on training engine](./docs/en/tutorials/getting_started_en.md) - [Python inference](./docs/en/tutorials/getting_started_en.md) diff --git a/README_cn.md b/README_cn.md index cd09230d..3cf677b4 100644 --- a/README_cn.md +++ b/README_cn.md @@ -7,8 +7,6 @@ 飞桨图像分类套件PaddleClas是飞桨为工业界和学术界所准备的一个图像分类任务的工具集,助力使用者训练出更好的视觉模型和应用落地。 -**注意**: 百度提出了一个新的图像分类网络结构 **`HS-ResNet`** ,基于ImageNet-1k数据集,`HS-ResNet`在与`ResNet`的params相近的情况下,Top-1 Acc达到了81.3%,相应的Arxiv文章链接可以参考这里:[HS-ResNet: Hierarchical-Split Block on Convolutional Neural Network](https://arxiv.org/pdf/2010.07621.pdf),模型结构和预训练模型参数即将开源,敬请期待! - **近期更新** - 2020.11.04 添加图像分类[常见问题2020第一季第一期](./docs/zh_CN/faq_series/faq_2020_s1.md) 7个新问题,并且计划以后每周一会更新,欢迎大家持续关注。 - 2020.10.20 添加 `Res2Net50_vd_26w_4s_ssld `模型,在ImageNet-1k上Top-1 Acc可达83.1%;添加 `Res2Net101_vd_26w_4s_ssld `模型,在ImageNet-1k上Top-1 Acc可达83.9%。 @@ -65,6 +63,7 @@ - [数据准备](./docs/zh_CN/tutorials/data.md) - [模型训练与微调](./docs/zh_CN/tutorials/getting_started.md) - [模型评估](./docs/zh_CN/tutorials/getting_started.md) + - [配置文件详解](./docs/zh_CN/tutorials/config.md) - 模型预测 - [基于训练引擎预测推理](./docs/zh_CN/tutorials/getting_started.md) - [基于Python预测引擎预测推理](./docs/zh_CN/tutorials/getting_started.md) diff --git a/docs/en/tutorials/config_en.md b/docs/en/tutorials/config_en.md index 3f32a3f4..72ca1dee 100644 --- a/docs/en/tutorials/config_en.md +++ b/docs/en/tutorials/config_en.md @@ -6,13 +6,17 @@ This document introduces the configuration(filed in `config/*.yaml`) of PaddleClas. +* Note: Some parameters do not appear in the yaml file (because they are not used for this file). During training or validation, you can use the command `-o` to update or add the specified parameters. For the example `-o checkpoints=./ckp_path/ppcls`, it means that the parameter `checkpoints` will be updated or added using the value `./ckp_path/ppcls`. + ### Basic | name | detail | default value | optional value | |:---:|:---:|:---:|:---:| | mode | mode | "train" | ["train"," valid"] | -| architecture | model name | "ResNet50_vd" | one of 23 architectures | +| checkpoints | checkpoint model path for resuming training process | "" | Str | +| last_epoch | last epoch for the training,used with checkpoints | -1 | int | | pretrained_model | pretrained model path | "" | Str | +| load_static_weights | whether the pretrained model is saved in static mode | False | bool | | model_save_dir | model stored path | "" | Str | | classes_num | class number | 1000 | int | | total_images | total images | 1281167 | int | @@ -24,10 +28,18 @@ This document introduces the configuration(filed in `config/*.yaml`) of PaddleCl | image_shape | image size | [3,224,224] | list, shape: (3,) | | use_mix | whether to use mixup | False | ['True', 'False'] | | ls_epsilon | label_smoothing epsilon value| 0 | float | +| use_distillation | whether to use SSLD distillation training | False | bool | + + +## ARCHITECTURE + +| name | detail | default value | optional value | +|:---:|:---:|:---:|:---:| +| name | model name | "ResNet50_vd" | one of 23 architectures | +| params | model parameters | {} | extra dictionary for the model structure, parameters such as `padding_type` in EfficientNet can be set here | -### Optimizer & Learning rate -learning rate +### LEARNING_RATE | name | detail | default value |Optional value | |:---:|:---:|:---:|:---:| @@ -39,7 +51,7 @@ learning rate | parmas.steps | decay steps in lineardecay | 100 | int | | params.end_lr | end lr in lineardecay | 0 | float | -optimizer +### OPTIMIZER | name | detail | default value | optional value | |:---:|:---:|:---:|:---:| diff --git a/docs/zh_CN/tutorials/config.md b/docs/zh_CN/tutorials/config.md index 55bbd808..9891cb9d 100644 --- a/docs/zh_CN/tutorials/config.md +++ b/docs/zh_CN/tutorials/config.md @@ -4,7 +4,10 @@ ## 简介 -本文档介绍了PaddleClas配置文件(configs/*.yaml)中各参数的含义,以便您更快的自定义或修改超参数配置。 +本文档介绍了PaddleClas配置文件(`configs/*.yaml`)中各参数的含义,以便您更快地自定义或修改超参数配置。 + +* 注意:部分参数并未在配置文件中体现,在训练或者评估时,可以直接使用`-o`进行参数的扩充或者更新,比如说`-o checkpoints=./ckp_path/ppcls`,表示在配置文件中添加(如果之前不存在)或者更新(如果之前已经包含该字段)`checkpoints`字段,其值设为`./ckp_path/ppcls`。 + ## 配置详解 @@ -13,8 +16,10 @@ | 参数名字 | 具体含义 | 默认值 | 可选值 | |:---:|:---:|:---:|:---:| | mode | 运行模式 | "train" | ["train"," valid"] | -| architecture | 模型结构名字 | "ResNet50_vd" | PaddleClas提供的模型结构 | +| checkpoints | 断点模型路径,用于恢复训练 | "" | Str | +| last_epoch | 上一次训练结束时已经训练的epoch数量,与checkpoints一起使用 | -1 | int | | pretrained_model | 预训练模型路径 | "" | Str | +| load_static_weights | 加载的模型是否为静态图的预训练模型 | False | bool | | model_save_dir | 保存模型路径 | "" | Str | | classes_num | 分类数 | 1000 | int | | total_images | 总图片数 | 1281167 | int | @@ -26,10 +31,18 @@ | image_shape | 图片大小 | [3,224,224] | list, shape: (3,) | | use_mix | 是否启用mixup | False | ['True', 'False'] | | ls_epsilon | label_smoothing epsilon值| 0 | float | +| use_distillation | 是否进行模型蒸馏 | False | bool | + + +## 结构(ARCHITECTURE) + +| 参数名字 | 具体含义 | 默认值 | 可选值 | +|:---:|:---:|:---:|:---:| +| name | 模型结构名字 | "ResNet50_vd" | PaddleClas提供的模型结构 | +| params | 模型传参 | {} | 模型结构所需的额外字典,如EfficientNet等配置文件中需要传入`padding_type`等参数,可以通过这种方式传入 | -### 学习率与优化器 -学习率 +### 学习率(LEARNING_RATE) | 参数名字 | 具体含义 | 默认值 | 可选值 | |:---:|:---:|:---:|:---:| @@ -41,7 +54,7 @@ | parmas.steps | lineardecay衰减steps数 | 100 | int | | params.end_lr | lineardecayend_lr值 | 0 | float | -优化器 +### 优化器(OPTIMIZER) | 参数名字 | 具体含义 | 默认值 | 可选值 | |:---:|:---:|:---:|:---:| -- GitLab