Skip to content

Commit

Permalink
[Docs] Update Docs about load_from (open-mmlab#953)
Browse files Browse the repository at this point in the history
* load from

* CN and faq
  • Loading branch information
dreamerlin authored Jun 23, 2021
1 parent d92fcc6 commit d4c3ba0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ If the contents here do not cover your issue, please create an issue using the [
]
```

- **How to set `load_from` value in config files to finetune models?**

In MMAction2, We set `load_from=None` as default in `configs/_base_/default_runtime.py` and owing to [inheritance design](/docs/tutorials/1_config.md),
users can directly change it by setting `load_from` in their configs.

## Testing

- **How to make predicted score normalized by softmax within [0, 1]?**
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/2_finetune.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ checkpoint_config = dict(interval=5)
## Use Pre-Trained Model

To use the pre-trained model for the whole network, the new config adds the link of pre-trained models in the `load_from`.
We set `load_from=None` as default in `configs/_base_/default_runtime.py` and owing to [inheritance design](/docs/tutorials/1_config.md), users can directly change it by setting `load_from` in their configs.

```python
# use the pre-trained model for the whole TSN network
Expand Down
4 changes: 4 additions & 0 deletions docs_zh_CN/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@

实际上,除了少数模型,如 C3D 等,用户都能通过设置 `frozen_stages` 来冻结模型参数,因为大多数主干网络继承自 `ResNet``ResNet3D`,而这两个模型都支持 `_freeze_stages()` 方法。

- **如何在配置文件中设置 `load_from` 参数以进行模型微调?**

MMAction2 在 `configs/_base_/default_runtime.py` 文件中将 `load_from=None` 设为默认。由于配置文件的可继承性,用户可直接在下游配置文件中设置 `load_from` 的值来进行更改。

## 测试

- **如何将预测分值用 softmax 归一化到 [0, 1] 区间内?**
Expand Down
1 change: 1 addition & 0 deletions docs_zh_CN/tutorials/2_finetune.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ checkpoint_config = dict(interval=5)
## 使用预训练模型

若要将预训练模型用于整个网络(主干网络设置中的 `pretrained`,仅会在主干网络模型上加载预训练参数),可通过 `load_from` 指定模型文件路径或模型链接,实现预训练权重导入。
MMAction2 在 `configs/_base_/default_runtime.py` 文件中将 `load_from=None` 设为默认。由于配置文件的可继承性,用户可直接在下游配置文件中设置 `load_from` 的值来进行更改。

```python
# 将预训练模型用于整个 TSN 网络
Expand Down

0 comments on commit d4c3ba0

Please sign in to comment.