Skip to content

Auto increment version for CSVLogger likeTensorBoardLogger in Fabric #17886

@dinhanhx

Description

@dinhanhx

Description & Motivation

TensorBoardLogger auto increments next version, but CSVLogger doesn't, which I believe it's inconsistent.

from lightning.fabric.loggers import TensorBoardLogger logger = TensorBoardLogger("throw_away") logger.log_metrics({"loss": 0.235, "acc": 0.75}) logger.finalize("success")

When running twice, it will create version_0 then version_1 folders.

However,

from lightning.fabric.loggers import CSVLogger logger = CSVLogger("throw_away") logger.log_metrics({"loss": 0.235, "acc": 0.75}) logger.finalize("success")

will give off the warning: /opt/conda/lib/python3.10/site-packages/lightning/fabric/loggers/csv_logs.py:186: UserWarning: Experiment logs directory throw_away/lightning_logs/version_0 exists and is not empty. Previous log files in this directory will be deleted when the new ones are saved!
rank_zero_warn(

Pitch

Given the following code,

from lightning.fabric.loggers import CSVLogger logger = CSVLogger("throw_away") logger.log_metrics({"loss": 0.235, "acc": 0.75}) logger.finalize("success")

When running this code twice (or again), the logger should create the next version_{} folder instead of warning.

Alternatives

No response

Additional context

No response

cc @Borda @carmocca @justusschock @awaelchli

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfabriclightning.fabric.Fabric

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions