mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Improve wandb logging
This commit is contained in:
parent
620cb4f3cb
commit
3a6cc4fb17
9
train.py
9
train.py
@ -386,6 +386,10 @@ group.add_argument('--use-multi-epochs-loader', action='store_true', default=Fal
|
|||||||
help='use the multi-epochs-loader to save time at the beginning of every epoch')
|
help='use the multi-epochs-loader to save time at the beginning of every epoch')
|
||||||
group.add_argument('--log-wandb', action='store_true', default=False,
|
group.add_argument('--log-wandb', action='store_true', default=False,
|
||||||
help='log training and validation metrics to wandb')
|
help='log training and validation metrics to wandb')
|
||||||
|
group.add_argument('--wandb-tags', default=[], type=str, nargs='+',
|
||||||
|
help='wandb tags')
|
||||||
|
group.add_argument('--wandb-resume-id', default='', type=str, metavar='ID',
|
||||||
|
help='If resuming a run, the id of the run in wandb')
|
||||||
|
|
||||||
|
|
||||||
def _parse_args():
|
def _parse_args():
|
||||||
@ -814,7 +818,10 @@ def main():
|
|||||||
|
|
||||||
if utils.is_primary(args) and args.log_wandb:
|
if utils.is_primary(args) and args.log_wandb:
|
||||||
if has_wandb:
|
if has_wandb:
|
||||||
wandb.init(project=args.experiment, config=args)
|
assert not args.wandb_resume_id or args.resume
|
||||||
|
wandb.init(project=args.experiment, config=args, tags=args.wandb_tags,
|
||||||
|
resume='must' if args.wandb_resume_id else None,
|
||||||
|
id=args.wandb_resume_id if args.wandb_resume_id else None)
|
||||||
else:
|
else:
|
||||||
_logger.warning(
|
_logger.warning(
|
||||||
"You've requested to log metrics to wandb but package not found. "
|
"You've requested to log metrics to wandb but package not found. "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user