Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] How to unfreeze the backbone network #7570

Merged
merged 5 commits into from
Apr 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pre-commit code
  • Loading branch information
Czm369 committed Mar 30, 2022
commit b535a01453598388aa024e3eaffe2617a1139fdf
6 changes: 3 additions & 3 deletions docs/en/tutorials/how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,17 @@ Meanwhile write the hook class `UnfreezeBackboneEpochBasedHook` in `mmdet/core/h
from mmcv.parallel import is_module_wrapper
from mmcv.runner.hooks import HOOKS, Hook


@HOOKS.register_module()
class UnfreezeBackboneEpochBasedHook(Hook):
"""Unfreeze backbone network Hook.

Args:
unfreeze_epoch (int): The epoch unfreezing the backbone network.
"""

def __init__(self, unfreeze_epoch=1):
self.unfreeze_epoch=unfreeze_epoch
self.unfreeze_epoch = unfreeze_epoch

def before_train_epoch(self, runner):
# Unfreeze the backbone network.
Expand All @@ -169,6 +171,4 @@ class UnfreezeBackboneEpochBasedHook(Hook):
m.train()
for param in m.parameters():
param.requires_grad = True


```