Skip to content

[Trainer] dictionary access to multiple named loggers #10636

@remisphere

Description

@remisphere

🚀 Feature

When using multiple loggers, being able to give a dict of loggers to the Trainer() instead of a list.

Motivation

I find the current list access when calling a single logger not explicit.

Pitch

trainer = Trainer(
    logger={
        'tensorboard': TensorBoardLogger(...),
        'csv': CSVLogger(...)},
    ...
)

then in the loop:

self.logger['tensorboard'].experiment.add_image(...)

instead of

self.logger[0].experiment.add_image(...)

There could be an ambiguity when using an integer as key, so maybe enforce string-only keys.

cc @Borda @awaelchli @edward-io @ananthsub @rohitgr7 @kamil-kaczmarek @Raalsky @Blaizzy @justusschock @kaushikb11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions