Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check all model in param groups #10

Open
lgvaz opened this issue May 9, 2023 · 0 comments
Open

Check all model in param groups #10

lgvaz opened this issue May 9, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@lgvaz
Copy link
Owner

lgvaz commented May 9, 2023

From icevision:

def check_all_model_params_in_groups2(model: nn.Module, param_groups: List[List[nn.Parameter]]):
    num_params = len([param for group in param_groups for param in group])
    num_params_expected = len(list(model.parameters()))

    if num_params != num_params_expected:
        raise RuntimeError(
            f"{num_params_expected} params in model but only {num_params} "
            "in parameter group"
        )
@lgvaz lgvaz added the enhancement New feature or request label May 9, 2023
@lgvaz lgvaz self-assigned this May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant