Add custom Tensoroard logger, remove CSV logger
The default behavior of Lightning's loggers is problematic, as they create a new file each time an experiment is run and it is not possible to resume logging using an existing file.
Each log file is in a subfolder named version_n
. Specifying a version when initializing the logger will overwrite that log instead of appending to it.
Lightning allows for the creation of custom loggers. We should implement our own version of TensorBoardLogger
which can save logs without version numbering and can resume logging if a file already exists.
In addition, we could remove the CSV logger and implement a translator from TensorBoard logs into CSV instead.
Implementation of the TensorBoardLogger
. It inherits from the Fabric
library.
- https://lightning.ai/docs/pytorch/stable/_modules/lightning/pytorch/loggers/tensorboard.html#TensorBoardLogger
- https://lightning.ai/docs/fabric/latest/_modules/lightning/fabric/loggers/tensorboard.html#TensorBoardLogger
Our custom logger could probably be simplified. This explains what a minimal logger implementation looks like:
https://lightning.ai/docs/pytorch/stable/extensions/logging.html#make-a-custom-logger