-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support for Weights and Biases logger (and possibly others) in Lightning CLI #7774
Comments
@mauvilsa cc |
From a quick look at this the problem seems to be only for the cases in which a WandbLogger is given values that should go to its init |
Maybe I am misunderstanding the question, |
@oplatek Did you try passing arguments to the wandb logger? For example, passing an 'entity' kwarg. |
@ohayonguy oh... I see, I just used the Now, I understand the problem, sorry I misunderstood it. I experienced this problem with LightningCLI too. I solved it by subclassing the parent and moving the argument from kwargs to regular argument in the inherited |
Ahh yup :) that's exactly what we did! |
@oplatek We still have a very annoying problem though, when we have nested pl.module classes that takes nn.Module as arguments. These can't be instantiated :( |
I think I solved this too (if I understand you correctly). |
This is happening because some init arguments in nn.Module classes don't have type hints. Currently in LightningCLI it is implemented that arguments without a type get the |
The issue is that I would propose that we improve the implementation of Please analyze and comment to see if the idea makes sense and to figure out what other issues there could be. |
@mauvilsa Your solution seems okay to me, although it's a "workaround". Is there a way to inherit form jsonargparse and change its behavior to our needs? I am not very familiar with it. Changing jsonargparse might be a better solution in the long term, and could give more flexibility (for example, instantiate nn.Modules in subclasses and stuff). |
@ohayonguy the The proposal for |
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! |
🚀 Feature
Adding support for weights and biases logger in lightning CLI
Motivation
Currently, instantiating a weights and biases logger from lightning CLI is not supported, and causes an error:
trainer.py: error: Parser key “trainer.logger”: Value “{‘class_path’: ‘pytorch_lightning.loggers.WandbLogger’, ‘init_args’: {‘entity’: ‘gip’, ‘project’: ‘solver’, ‘notes’: ‘notes’}}” does not validate against any of the types in typing.Union[pytorch_lightning.loggers.base.LightningLoggerBase, typing.Iterable[pytorch_lightning.loggers.base.LightningLoggerBase], bool] :: Problem with given class_path “pytorch_lightning.loggers.WandbLogger” :: ‘Configuration check failed :: No action for key “entity” to check its value.’ :: Expected a List but got “{‘class_path’: ‘pytorch_lightning.loggers.WandbLogger’, ‘init_args’: {‘entity’: ‘gip’, ‘project’: ‘solver’, ‘notes’: ‘notes’}}” :: Expected a <class ‘bool’> but got “{‘class_path’: ‘pytorch_lightning.loggers.WandbLogger’, ‘init_args’: {‘entity’: ‘gip’, ‘project’: ‘solver’, ‘notes’: ‘notes’}}”
Pitch
I want to be able to initialize a WandbLogger from the yaml file, and also be able to run wandb sweeps.
The text was updated successfully, but these errors were encountered: