Init and config in different files

Hi all,
I want to seperate the wandb.config from wandb.init in my training script. Howerever I cant seem to get around a circular import when trying to do this. I had a workaround where I use .init(mode=“offline”), so I can use wandb.config() afterwards and then call init() again in the training script. However this does not seem to work with sweeps.

  1. In settings.py: Run wandb.config()
  2. In training.py: From settings import config
    Run wandb.init() in training.py

I feel like there is an obvious solution, but I cant seem to find it.
Thanks!

Hi @nime6,
I may need to know a little bit more about the use case here. My initial thought is to save config as a .yaml and then read that into your training.py where you could pass it into wandb.init(config=<your_yaml_converted_to_a_dict>)

This also might be a use case for using a file based config.

If that doesn’t seem like what you are looking for could you elaborate more on why you are trying to set wandb.config()outside of the training script?

Thank you,
Nate

Hi @nime6, I just wanted to follow up on this and see if they above would work for you in this case?

Thank you,
Nate