Lightning-AI / Lightning-AI/pytorch-lightning
W&B `dir` flag doesn't work.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Bug description
Initialising `WandbLogger` with `save_dir=...` properly sets the directory for the `wandb` folder with the logs files. `dir=` doesn't work and `wandb` is saved in the `os.cwd()`.
### What version are you seeing the problem on?
v2.0
### How to reproduce the bug
```python
from lightning.pytorch.loggers import WandbLogger
WandbLogger(project="abc-123", config=vars(args), save_dir=cluster.log_dir, mode=("disabled" if args.debug else "online")))
```
vs
```python
from lightning.pytorch.loggers import WandbLogger
WandbLogger(project="abc-123", config=vars(args), dir=cluster.log_dir, mode=("disabled" if args.debug else "online")))
```
yield different results.
```
### Error messages and logs
```
# Error messages and logs here please
```
N?A
### Environment
```
# Name Version Build Channel
lightning 2.0.2 pypi_0 pypi
lightning-cloud 0.5.38 pypi_0 pypi
lightning-utilities 0.9.0 pypi_0 pypi
pytorch-lightning 2.0.9 pypi_0 pypi
wandb 0.15.10 pypi_0 pypi
```
Ubuntu 22.04. Python 3.10.
### More info
N/A
cc @awaelchli @morganmcg1 @borisdayma @scottire @parambharat
Contributor guide
Research direction
Start by inspecting the WandbLogger entry point and how its save_dir and dir arguments are passed to the wandb integration. Reproduce the two constructor examples from the issue and compare where the wandb folder and log files are created. Done means dir produces the expected directory behavior consistently with the reported save_dir case, with coverage for the difference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100