Skip to content

Commit

Permalink
Fix the finetune command in zh_CN yolov5_tutorial.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaAndroid committed Sep 21, 2022
1 parent c068dcd commit 2aad4fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions configs/yolox/yolox_nano_8xb8-300e_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
neck=dict(
deepen_factor=deepen_factor,
widen_factor=widen_factor,
use_depthwise=True),
use_depthwise=use_depthwise),
bbox_head=dict(
head_module=dict(widen_factor=widen_factor, use_depthwise=True)))
head_module=dict(
widen_factor=widen_factor, use_depthwise=use_depthwise)))
8 changes: 6 additions & 2 deletions docs/zh_cn/user_guides/yolov5_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ wget https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-v61_syncbn_fast_8x
```shell
cd mmyolo
python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py \
--cfg-options load_from='yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth' custom_hooks.0.strict_load=False
--cfg-options load_from='yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth' custom_hooks=None
```

注意: 必须要设置 `custom_hooks.0.strict_load=False`, 将 EMAHook 的 strict_load 初始化参数设置为 False,否则会报权重不匹配的错误
注意: 原则上在微调阶段应该将 `EMAHook``strict_load` 初始化参数设置为 `False` 即命令为 `custom_hooks.0.strict_load=False`。但由于 MMEngine v0.1.0 为初期开发版本,目前这样设置会出现问题。因此暂时只能通过命令 `custom_hooks=None`,关闭 `custom_hooks` 使用,从而正确加载预训练权重。预计会在下个版本修复此问题

3. 冻结 backbone 进行训练

Expand Down Expand Up @@ -207,3 +207,7 @@ python tools/test.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.p
<div align=center>
<img src="https://user-images.githubusercontent.com/27466624/190913272-f99709e5-c798-46b8-aede-30f4e91683a3.jpg" alt="result_img"/>
</div>

## 模型部署

正在准备中,敬请期待!

0 comments on commit 2aad4fd

Please sign in to comment.