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

can't pass resume flag to WandbLogger #6788

Closed
AsaphLightricks opened this issue Apr 1, 2021 · 4 comments · Fixed by #6989
Closed

can't pass resume flag to WandbLogger #6788

AsaphLightricks opened this issue Apr 1, 2021 · 4 comments · Fixed by #6989
Assignees
Labels
3rd party Related to a 3rd-party bug Something isn't working logger Related to the Loggers
Milestone

Comments

@AsaphLightricks
Copy link

https://github.com/PyTorchLightning/pytorch-lightning/blob/e7abd8e89bcc26a97203119f77f9c59dcb0d8791/pytorch_lightning/loggers/wandb.py#L161

I can't override the resume=allow. If i try passing the WandbLogger resume=True for instance i get this error:

Traceback (most recent call last):
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/hydra/_internal/utils.py", line 361, in _run_hydra
    run_and_report(
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/hydra/_internal/utils.py", line 213, in run_and_report
    raise ex
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/hydra/_internal/utils.py", line 210, in run_and_report
    return func()
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/hydra/_internal/utils.py", line 362, in <lambda>
    lambda: hydra.run(
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 93, in run
    return run_job(
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/hydra/core/utils.py", line 129, in run_job
    ret.return_value = task_function(task_cfg)
  File "/Users/ashamir/PycharmProjects/pytorch-lightning-template/src/train.py", line 113, in main
    trainer.fit(model=lightning_module, datamodule=data_module)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 474, in fit
    self.setup_trainer(model)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 421, in setup_trainer
    self.logger.log_hyperparams(model.hparams_initial)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/loggers/base.py", line 380, in log_hyperparams
    logger.log_hyperparams(params)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/utilities/distributed.py", line 40, in wrapped_fn
    return fn(*args, **kwargs)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/loggers/wandb.py", line 178, in log_hyperparams
    self.experiment.config.update(params, allow_val_change=True)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/loggers/base.py", line 41, in experiment
    return get_experiment() or DummyExperiment()
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/utilities/distributed.py", line 40, in wrapped_fn
    return fn(*args, **kwargs)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/loggers/base.py", line 39, in get_experiment
    return fn(self)
  File "/Users/ashamir/opt/miniconda3/envs/pytorch-lightning-template/lib/python3.8/site-packages/pytorch_lightning/loggers/wandb.py", line 152, in experiment
    self._experiment = wandb.init(
TypeError: init() got multiple values for keyword argument 'resume'

This flag should be configureable just like the others.
@borisdayma

@borisdayma
Copy link
Contributor

That's a good point!
In the meantime you could call wandb.init separately and WandbLogger will not create a new run.

@stale
Copy link

stale bot commented May 1, 2021

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!

@stale stale bot added the won't fix This will not be worked on label May 1, 2021
@borisdayma
Copy link
Contributor

There's PR #6989 open for this issue.

@stale stale bot removed the won't fix This will not be worked on label May 1, 2021
@awaelchli
Copy link
Member

somehow nobody labelled this.
labelling now as bugifx.
thanks @borisdayma

@awaelchli awaelchli added bug Something isn't working logger Related to the Loggers 3rd party Related to a 3rd-party labels May 1, 2021
@awaelchli awaelchli added this to the v1.3 milestone May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Related to a 3rd-party bug Something isn't working logger Related to the Loggers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants