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

Wandb logger conflict using LightningCLI #1621

Closed
robmarkcole opened this issue Oct 5, 2023 · 1 comment · Fixed by #1625
Closed

Wandb logger conflict using LightningCLI #1621

robmarkcole opened this issue Oct 5, 2023 · 1 comment · Fixed by #1625
Labels
scripts Training and evaluation scripts
Milestone

Comments

@robmarkcole
Copy link
Contributor

Description

When using the Wandb logger with Lightning CLI a config.yaml will be written to the working dir and cause subsequent runs to error and fail until this file is deleted. This is due to Lightning-AI/pytorch-lightning#17168

The workaround is to pass LightningCLI(save_config_kwargs={"overwrite": True}) in torchgeo.main.py

Steps to reproduce

In lightning config:

trainer:
  min_epochs: 10
  max_epochs: 50
  logger:
    class_path: lightning.pytorch.loggers.wandb.WandbLogger
    init_args:
      project: my-proj

Will result in

RuntimeError: SaveConfigCallback expected ./config.yaml to NOT exist. Aborting to avoid overwriting results of a previous run. You can delete the previous config file, set `LightningCLI(save_config_callback=None)` to disable config saving, or set `LightningCLI(save_config_kwargs={"overwrite": True})` to overwrite the config file.

Version

0.5.0

@adamjstewart
Copy link
Collaborator

I'm fine with this workaround. Want to submit a PR?

@adamjstewart adamjstewart added this to the 0.5.1 milestone Oct 5, 2023
@adamjstewart adamjstewart added the scripts Training and evaluation scripts label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scripts Training and evaluation scripts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants