Skip to content

Commit 4af775e

Browse files
Merge pull request #205 from yoshitomo-matsubara/dev
Freeze modules before build
2 parents aea8f5b + e1818b6 commit 4af775e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torchdistill/models/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ def redesign_model(org_model, model_config, model_label, model_type='original'):
9393

9494
module_dict = OrderedDict()
9595
adaptation_dict = model_config.get('adaptations', dict())
96+
97+
for frozen_module_path in frozen_module_path_set:
98+
module = get_module(org_model, frozen_module_path)
99+
freeze_module_params(module)
100+
96101
for module_path in module_paths:
97102
if module_path.startswith('+'):
98103
module_path = module_path[1:]

0 commit comments

Comments
 (0)