wandb / wandb

🔥 A tool for visualizing and tracking your machine learning experiments. This repo contains the CLI and Python API.
https://wandb.ai
MIT License
8.61k stars 636 forks source link

[CLI]: Sweep nested parameters #3827

Open EhssanD opened 2 years ago

EhssanD commented 2 years ago

Describe the bug

The grid search does not work properly with nested config. It fails to iterate over possible values and never ends.

program: test_run.py
method: grid
metric:
  goal: minimize
  name: val_loss
parameters:
  optimizer:
    parameters:
      learning_rate:
        values: [0.01, 0.001]
      momentum:
        value: 0.9

import wandb

defaults = dict(
    optimizer={
        "learning_rate": 0.2,
        "momentum": 0.9
    },
)

wandb.init(config=defaults)
wandb.log({
    "val_loss": 0.7
})

Additional Files

No response

Environment

WandB version: 0.12.18

OS: Ubuntu 18.04

Python version: 3.8.12

Additional Context

No response

armanhar commented 2 years ago

Hey @EhssanD, thanks for flagging this. I'll try to reproduce this and get back to you.

armanhar commented 2 years ago

Hey @EhssanD, are you using the Local version of W&B or the public one?

EhssanD commented 2 years ago

Hi @armanhar We used the public one.

I basically tried to get Grid search working for nested parameters and it didn't do it properly. It's interesting that both Random and Bayes methods seem to be fine. In the end I just manually flattened the parameters in the config.

armanhar commented 2 years ago

Hey @EhssanD, could you update your client to the latest version and notify me if the issue persists?

armanhar commented 2 years ago

Hey @EhssanD, ​I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved. ​

armanhar commented 1 year ago

Hey @EhssanD, since we have not heard back from you, I'll be closing this ticket. Please feel free to message me if you are still experiencing this issue.

exalate-issue-sync[bot] commented 1 year ago

WandB Internal User commented: armanhar commented: Hey @EhssanD, since we have not heard back from you, I'll be closing this ticket. Please feel free to message me if you are still experiencing this issue.