Skip to content

Commit

Permalink
Update train.py
Browse files Browse the repository at this point in the history
Fix the bug of always the same W&B ID  and continue  overwrite with the old logging.
BUG report
ultralytics#1851
  • Loading branch information
TommyZihao authored Jan 6, 2021
1 parent 69be8e7 commit 726206a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
# Logging
if rank in [-1, 0] and wandb and wandb.run is None:
opt.hyp = hyp # add hyperparameters
wandb_ID = wandb.util.generate_id()
wandb_run = wandb.init(config=opt, resume="allow",
project='YOLOv5' if opt.project == 'runs/train' else Path(opt.project).stem,
name=save_dir.stem,
id=ckpt.get('wandb_id') if 'ckpt' in locals() else None)
id=wandb_ID)
loggers = {'wandb': wandb} # loggers dict

# Resume
Expand Down

0 comments on commit 726206a

Please sign in to comment.