wandb: [Bug]: `wandb disabled` is a no-op

Describe the bug

I am running wandb disabled before running a script, but things still get logged. I’ve tried both the old (deprecated) backend as well as the new one. Image

It even happens with the following (attached below) MWE: Image

MWE:


import wandb

# Initialize a new W&B run
wandb.init(project="minimal-example")

# Log a single value (e.g., accuracy)
wandb.log({"accuracy": 0.95})

# Finish the run
wandb.finish()

wandb version: 0.18.3 python version: Python 3.10.15 OS (uname -r): 5.15.153.1-microsoft-standard-WSL2

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@HekpoMaH this is indeed a bug, but to overcome this i suggest for now just set the env variable WANDB_MODE="disabled" manually and i think it should disable wandb for you

Image Image 🤷

I guess wandb people can tell more what’s going on

@HekpoMaH it seems to work as expected? what is the issue you are having when you set the env variable to disabled it disables wandb when you don’t it won’t.

UPDATE: when passing settings to wandb.init, the env variable gets ignored

@macio232

Remember that

WANDB_MODE="disabled"
python mwe.py

Does nothing, as wandb mode is set only until you press Enter. You need to either do:

WANDB_MODE="disabled" python mwe.py

or (the 2nd one, I have tried and it works)

export WANDB_MODE="disabled"
python mwe.py

Once exported for the terminal session, you don’t need to set the variable again.