sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Feature request: LayerLogger for Pytorch Lightning

Open fcakyon opened this issue 2 years ago • 5 comments

Pytorch Lightning is the most accepted model training framework among Pytorch community.

Currently it includes logger wrappers for MLFlow, Neptune, Tensorboard, WANDB etc: https://pytorch-lightning.readthedocs.io/en/stable/common/loggers.html

Would be great if LayerLogger class could be added.

fcakyon avatar Jun 28 '22 11:06 fcakyon

Should be pretty straightforward to implement as we already have some callback loggers. Anything specific you want to see in the logs? @fcakyon

mecevit avatar Jun 28 '22 12:06 mecevit

Being able to log hyperparams at the start, epoch-based metrics, predictions images/videos per epoch, confusion matrix images per epoch, and checkpoint files are the most essential functions for me.

fcakyon avatar Jun 28 '22 13:06 fcakyon

This PR solves this issue I believe: https://github.com/layerai/sdk/pull/312 How to import the LayerLogger class?

fcakyon avatar Aug 16 '22 13:08 fcakyon

I'm working on a notebook, I'll link it here shortly @fcakyon

mecevit avatar Aug 16 '22 13:08 mecevit

@fcakyon Here you go:

from pytorch_lightning import Trainer

from layer import PytorchLightningLogger
layer_logger = PytorchLightningLogger(project_name='MNIST', api_key='[YOUR_API_KEY]')

trainer = Trainer(
        logger=layer_logger,
        accelerator='gpu', devices=1)  
trainer.fit(model, training_loader, validation_loader)

Notebook: https://colab.research.google.com/drive/1ygiC7R-mozacXq_tSCAj8wBbUE05xTpN?usp=sharing

mecevit avatar Aug 16 '22 14:08 mecevit