diff --git a/mmrazor/models/task_modules/tracer/fx/custom_tracer.py b/mmrazor/models/task_modules/tracer/fx/custom_tracer.py index 68d5f0809..17e717cae 100644 --- a/mmrazor/models/task_modules/tracer/fx/custom_tracer.py +++ b/mmrazor/models/task_modules/tracer/fx/custom_tracer.py @@ -146,9 +146,9 @@ def _get_attrs(target, attrs): for special_node in special_nodes: if special_node in node.args or \ special_node in node.kwargs.values(): - origin_module = getattr(model, special_node.target) + origin_module = _get_attrs(model, special_node.target) setattr(module_dict[special_node.target], node.target, - getattr(origin_module, node.target)) + _get_attrs(origin_module, node.target)) return module_dict