Hi, while starting to get familiar with wandb
I ran into a bug.
I was testing a very simple setup with the following file:
train.py
import wandb
import random
import logging
log = logging.getLogger(__name__)
def train():
with wandb.init(
entity="jeroenboss",
project="wandb_demo"
) as run:
log.info(f"Running experiment with name {run.name}")
config = run.config
log.info(f"Loaded configuration: {config}")
accuracy = 0
for x in range(config.get('epochs', 100)):
accuracy += (1 - accuracy) * (random.random()*0.9+0.1) * config.get('alpha', 0.1)
run.log({"accuracy": accuracy})
log.info("Finished")
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
train()
Because I was testing a few things I wanted to prevent uploading the runs to your servers before I had figured out some bugs. But when I tried to use the wandb offline
command, it did not seem to work.
After some testing I found that setting WANDB_DIR
in my ~/.bashrc
breaks the functionality. Below you can see the output of my commands. Removing WANDB_DIR
made everything work correctly.
(wandb_demo) jeroen@jeroen-ThinkPad-P50:~/sandbox/wandb_test$ wandb status
Current Settings
{
"base_url": "https://api.wandb.ai",
"entity": null,
"git_remote": "origin",
"ignore_globs": [],
"project": null,
"section": "default"
}
(wandb_demo) jeroen@jeroen-ThinkPad-P50:~/sandbox/wandb_test$ wandb offline
W&B offline, running your script from this directory will only write metadata locally.
(wandb_demo) jeroen@jeroen-ThinkPad-P50:~/sandbox/wandb_test$ wandb status
Current Settings
{
"base_url": "https://api.wandb.ai",
"disabled": "true",
"entity": null,
"git_remote": "origin",
"ignore_globs": [],
"mode": "offline",
"project": null,
"section": "default"
}
(wandb_demo) jeroen@jeroen-ThinkPad-P50:~/sandbox/wandb_test$ python train.py
wandb: Currently logged in as: jeroenboss (use `wandb login --relogin` to force relogin)
wandb: Tracking run with wandb version 0.12.6
wandb: Syncing run misunderstood-night-24
wandb: βοΈ View project at https://wandb.ai/jeroenboss/wandb_demo
wandb: π View run at https://wandb.ai/jeroenboss/wandb_demo/runs/kv7r7fst
wandb: Run data is saved locally in /home/jeroen/.wandb/runs/wandb/run-20211105_121404-kv7r7fst
wandb: Run `wandb offline` to turn off syncing.
INFO:__main__:Running experiment with name misunderstood-night-24
INFO:__main__:Loaded configuration: {'epochs': 50, 'alpha': 0.1}
INFO:__main__:Finished
wandb: Waiting for W&B process to finish, PID 17238... (success).
wandb:
wandb: Run history:
wandb: accuracy βββββββββββ
β
β
β
β
βββββββββββββββββββββββββ
wandb:
wandb: Run summary:
wandb: accuracy 0.95235
wandb:
wandb: Synced 7 W&B file(s), 0 media file(s), 0 artifact file(s) and 1 other file(s)
wandb: Synced misunderstood-night-24: https://wandb.ai/jeroenboss/wandb_demo/runs/kv7r7fst
wandb: Find logs at: /home/jeroen/.wandb/runs/wandb/run-20211105_121404-kv7r7fst/logs/debug.log
wandb:
(wandb_demo) jeroen@jeroen-ThinkPad-P50:~/sandbox/wandb_test$ wandb status
Current Settings
{
"base_url": "https://api.wandb.ai",
"disabled": "true",
"entity": null,
"git_remote": "origin",
"ignore_globs": [],
"mode": "offline",
"project": null,
"section": "default"
}
Iβm running Python 3.7.12 and wandb 0.12.6
I would like to store my runs in a central folder, so I would like to be able to use WANDB_DIR
.