Skip to content

Commit

Permalink
Change strict_load of EMAHook to False by default (#642)
Browse files Browse the repository at this point in the history
* [Fix] resume std and mean

* refine docstring

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
  • Loading branch information
HAOCHENYE and zhouzaida committed Oct 28, 2022
1 parent 4aad15d commit d1d32df
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mmengine/hooks/ema_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ class EMAHook(Hook):
Defaults to 'ExponentialMovingAverage'.
strict_load (bool): Whether to strictly enforce that the keys of
``state_dict`` in checkpoint match the keys returned by
``self.module.state_dict``. Defaults to True.
``self.module.state_dict``. Defaults to False.
Changed in v0.3.0.
begin_iter (int): The number of iteration to enable ``EMAHook``.
Defaults to 0.
begin_epoch (int): The number of epoch to enable ``EMAHook``. Defaults
to 0.
begin_epoch (int): The number of epoch to enable ``EMAHook``.
Defaults to 0.
**kwargs: Keyword arguments passed to subclasses of
:obj:`BaseAveragedModel`
"""
Expand All @@ -40,7 +41,7 @@ class EMAHook(Hook):

def __init__(self,
ema_type: str = 'ExponentialMovingAverage',
strict_load: bool = True,
strict_load: bool = False,
begin_iter: int = 0,
begin_epoch: int = 0,
**kwargs):
Expand Down

0 comments on commit d1d32df

Please sign in to comment.