diff --git a/src/pet/utils/other.py b/src/pet/utils/other.py index 0b63248..b7a81d5 100644 --- a/src/pet/utils/other.py +++ b/src/pet/utils/other.py @@ -57,7 +57,7 @@ def fsdp_auto_wrap_policy(model): def lambda_policy_fn(module): if ( - len(module.named_children()) == 0 + len(list(module.named_children())) == 0 and getattr(module, "weight", None) is not None and module.weight.requires_grad ):