Skip to content
New issue

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

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

Already on GitHub? # to your account

Initialization of WandBLogger with init=True fails #3272

Closed
zubatyuk opened this issue Aug 2, 2024 · 2 comments · Fixed by #3273
Closed

Initialization of WandBLogger with init=True fails #3272

zubatyuk opened this issue Aug 2, 2024 · 2 comments · Fixed by #3273

Comments

@zubatyuk
Copy link
Contributor

zubatyuk commented Aug 2, 2024

wandb.init function does not have 'init' keyword argument.
Therefore, this code fails:

        if kwargs.get("init", True):
            wandb.init(*args, **kwargs)

Solution is to pop 'init' key from kwargs.

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Aug 3, 2024

@zubatyuk Thanks for reporting the issue and sending a PR! Seems like init arg never existed for wandb.init function.

In pytorch-ignite code looks like it worked as no one previously tried to pass init as kwargs and by default it calls wandb.init.
In your use case are you passing it explicitly and which value do you pass?

@zubatyuk
Copy link
Contributor Author

zubatyuk commented Aug 3, 2024

There are two usage patterns.
1.

import wandb
from ignite.handlers import WandBLogger

wandb_logger = WandBLogger()
wandb.init(**wandb_kwargs)
wandb_log_dir = wandb.log.dir
from ignite.handlers import WandBLogger

wandb_logger = WandBLogger(init=True, **wandb_kwargs)
wandb_log_dir = wandb_logger.log.dir 

Apparently, everyone was using first pattern, even though proper __getattr__ implemented in WandBLogger.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants