Skip to content

Commit d7f6477

Browse files
Update docs/zh_cn/user_guides/useful_hooks.md
Co-authored-by: BigDong <yudongwang1226@gmail.com>
1 parent e851f0b commit d7f6477

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/zh_cn/user_guides/useful_hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The system has 250 GB (246360 MB + 9407 MB) of memory and 8 GB (5740 MB + 2452 M
5656

5757
比如,我们要实现一个检查 loss 的钩子,当损失为 NaN 时自动结束训练。我们可以把这个过程分为三步:
5858

59-
1. 在MMEngine实现一个继承于 `Hook` 类的新钩子,并实现 `after_train_iter` 方法用于检查每 `n` 次训练迭代后损失是否变为 NaN 。
59+
1. 在 MMEngine 实现一个继承于 `Hook` 类的新钩子,并实现 `after_train_iter` 方法用于检查每 `n` 次训练迭代后损失是否变为 NaN 。
6060
2. 使用 `@HOOKS.register_module()` 注册实现好了的自定义钩子,如下列代码所示。
6161
3. 在配置文件中添加 `custom_hooks = [dict(type='MemoryProfilerHook', interval=50)]`
6262

0 commit comments

Comments
 (0)