Skip to content

[WandbLogger] resume="never" without id still tries to resume existing run #21248

@oooooio

Description

@oooooio

Bug description

When using Lightning CLI with WandbLogger, I did not set an id and configured resume="never". However, the run fails with the following error:

wandb.errors.errors.UsageError: You provided an invalid value for the `resume` argument. The value 'never' is not a valid option for resuming a run (AUWave) that already exists.

According to W&B semantics, resume="never" should not attempt to resume any existing run. If no id is set, it should not conflict with an existing run either.

•When resume="never" and no id is explicitly provided, the logger should not try to resume an existing run.
•Lightning should not accidentally propagate a historical run id from the working directory into W&B, leading to a conflict with the "never" setting.

What version are you seeing the problem on?

v2.5

Reproduced in studio

No response

How to reproduce the bug

lightning run model fit \
  --trainer.logger lightning.pytorch.loggers.WandbLogger \
  --trainer.logger.init_args.project test
  --trainer.logger.init_args.save_dir ./wandb_logs
  --trainer.logger.init_args.log_model true
  --trainer.logger.init_args.resume never
  # Note: no id provided

Error messages and logs

# Error messages and logs here please

Environment

Current environment
#- PyTorch Lightning Version (e.g., 2.5.0):
#- PyTorch Version (e.g., 2.5):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):

More info

No response

cc @lantiga @morganmcg1 @borisdayma @scottire @parambharat @mauvilsa

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions