Skip to content

Commit

Permalink
Update finetune.md
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixgame2018 authored Feb 23, 2022
1 parent c0a6822 commit 67627fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/zh_cn/tutorials/finetune.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

```python
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/cityscapes_instance.py', '../_base_/default_runtime.py'
]
```

## Head 的修改
接下来新的配置还需要根据新数据集的类别数量对 Head 进行修改。只需要对 roi_head `num_classes`进行修改。修改后除了最后的预测模型的 Head 之外,预训练模型的权重的大部分都会被重新使用。
接下来新的配置还需要根据新数据集的类别数量对 Head 进行修改。只需要对 roi_head 中的 `num_classes`进行修改。修改后除了最后的预测模型的 Head 之外,预训练模型的权重的大部分都会被重新使用。

```python
model = dict(
Expand Down Expand Up @@ -77,7 +77,7 @@ log_config = dict(interval=100)

## 使用预训练模型

如果要使用预训练模型时,可以在`load_from`中查阅新的配置信息,用户需要在训练开始之前下载好需要的模型权重,从而避免在训练过程中浪费了宝贵时间。
如果要使用预训练模型时,可以在 `load_from` 中查阅新的配置信息,用户需要在训练开始之前下载好需要的模型权重,从而避免在训练过程中浪费了宝贵时间。
```python
load_from = 'https://download.openmmlab.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth' # noqa
```

0 comments on commit 67627fa

Please sign in to comment.