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

Stop searching after raising Skip Oversized model error #989

Open
Mojtaba1515 opened this issue Feb 23, 2024 · 1 comment
Open

Stop searching after raising Skip Oversized model error #989

Mojtaba1515 opened this issue Feb 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Mojtaba1515
Copy link

Describe the bug

I have developed a code for searching different CNN models with a specific number of parameters, however after an architecture sampled during the optimization that exceeds the number of parameters, it stops searching by raising an error of "Oversized model: 180376 parameters. Skip model."

Expected behavior

It should skip that specific model and takes the second sample until it finishes the maximum number of trials.

@Mojtaba1515 Mojtaba1515 added the bug Something isn't working label Feb 23, 2024
@TitoNicolaDrugman
Copy link

Same here. I made a small work-around technique.

I am not familiar with Github, but basically this is what I made, it worked fine :)

I made a small variable outside get_model.

__run_once = True

This is the code, hope it will help!

__run_once = True   # set this True, if the code suddenly stops after at least one tuning you need to edit it and set it to False 

def get_model(args, hp):
    global __run_once 

    trial_param1 = hp.Int("num_layers", 1, 30, step=1)
    trial_param2 = hp.Choice("num_filters", [16, 32, 64])  
    trial_param3 = hp.Choice("dp_rate1", [0.0, 0.1, 0.2, 0.3, 0.4, 0.5])
    trial_param4 = hp.Choice("dp_rate2", [0.0, 0.1, 0.2, 0.3, 0.4, 0.5])
    trial_param5 = hp.Boolean("use_bias")

    m = build_model_with_params(args, trial_param1, trial_param2, trial_param3, trial_param4, trial_param5)

    if __run_once:
       __run_once = False
       return None
   
    return m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants