Skip to content

MMDet not logging to Wandb #12393

@YMRTZ

Description

@YMRTZ

I have the following code in my train.py:

    cfg = Config.fromfile(args.config)

    cfg.launcher = args.launcher
    if args.cfg_options is not None:
        cfg.merge_from_dict(args.cfg_options)

    log_hooks = cfg.log_config.hooks if 'hooks' in cfg.log_config else []
    wandb_hook = dict(
        type='MMDetWandbHook',
        init_kwargs={
            'entity': 'ymrtz',
            'project': 'mmdetection',
            'config': cfg._cfg_dict.to_dict()
        },
        interval=50,  # Log every 50 iterations (adjust as needed)
        log_checkpoint=True,  # Important: log model checkpoints
        log_checkpoint_metadata=True,
        num_eval_images=10,  # Log sample validation images
        out_dir=args.work_dir  # Match working directory
    )
    cfg.log_config.hooks = log_hooks + [wandb_hook]

However when running the training, nothing shows up in my Wandb dashboard. Am I missing some sort of additional configuration step?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions