Skip to content

Commit

Permalink
[Fix]: Fix _save_to_state_dict (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
HAOCHENYE authored Sep 22, 2022
1 parent c64243a commit 2e99ea3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mmengine/runner/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ def _save_to_state_dict(module, destination, prefix, keep_vars):
if param is not None:
destination[prefix + name] = param if keep_vars else param.detach()
for name, buf in module._buffers.items():
# remove check of _non_persistent_buffers_set to allow nn.BatchNorm2d
if buf is not None:
if buf is not None and name not in module._non_persistent_buffers_set:
destination[prefix + name] = buf if keep_vars else buf.detach()


Expand Down

0 comments on commit 2e99ea3

Please sign in to comment.