-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize API for logging images, histograms, etc. #6720
Comments
Dear @sharuevds, Sounds like a great idea ! Best, |
The difficulty here will be that integrations may allow different options. For example with
I really love the idea though! We should just try to provide as many options as possible to take best advantage of loggers capabilities. |
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! |
Would love to see this as well, there should be a way to abstract the API enough to cover all use cases. Worst case scenario these functions can accept kwargs or something if you know what logger you're interacting with. I can try to mock something up if my currently pending PR ever gets merged |
I would suggest to make these a part of self.log("loss", loss, on_step=True, on_epoch=True)
self.log_dict("metrics", metrics, on_step=True, on_epoch=True)
self.logger.experiment.log_images("input", input) # pls no
# vs
self.log_images("input", input) Making them part of the self.log_images("input", input, on_step=True, on_epoch=True) Users could still access the logger-specific methods from What do you think? |
For info it has already been implemented as part of master branch (see here) |
Actually, it is not implemented, I just tried with master branch:
|
I think the first simple step is to replace the exceptions in the |
As described in #12183 (comment) and the rest of the comments, closing. |
🚀 Feature
Standardized way to log non-scalar data
Motivation
Different logging backends supported by PL use different ways to log such data, so it would be very convenient to have standardized way to do it. I mentioned it in Slack and got approval to make a PR, so I want to discuss details here.
Pitch
Add methods that allow to log images, histograms or other data (audio, video, ...) to PL logger class.
Additional context
What is better?
If the function is called, but current logger backend doesn't support this type of content:
What signature should methods have?
log_images(images: Dict[str, image_types])
: consistent with existinglog_metrics
, but new method should be added for each type of data (log_images
,log_histograms
, ...); IMO best solutionlog_image(tag, image)
: consistent with Tensorboard, but can be inconvenient when logging multiple imageslog_metrics
where image wrapper is passed as value: consistent with WandB (uses its own wandb.Image wrapper), but requires user to create wrappers and increases complexityI am ready to make PR when details are discussed and approved.
The text was updated successfully, but these errors were encountered: