Skip to content
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

Please add a variant of add_image which accepts PNG as file #21

Closed
olegtarasov opened this issue Aug 27, 2017 · 2 comments
Closed

Please add a variant of add_image which accepts PNG as file #21

olegtarasov opened this issue Aug 27, 2017 · 2 comments

Comments

@olegtarasov
Copy link

olegtarasov commented Aug 27, 2017

Hi! I am plotting some custom stuff with pyplot during training and want to add these plots to TensorBoard as images. Since TensorBoard uses PNG, it would be really convenient to have add_image which accepts a file (or BytesIO) as input. It would be mush easier to save a plot to memory in PNG format and skip all that tensor juggling.

@lanpa
Copy link
Owner

lanpa commented Aug 27, 2017

HI, The next release (tensorboardX) will also support numpy array as input. I think it's better to let user handle the image loading things. Users only need to define a function to load whatever format they want and feed the numpy array to add_image. As for skipping file IO, do you use method like this: https://stackoverflow.com/questions/43363388/how-to-save-a-greyscale-matplotlib-plot-to-numpy-array or are there better ways?

thanks

@lanpa lanpa closed this as completed in 65dff02 Sep 25, 2017
@gar1t
Copy link
Contributor

gar1t commented Aug 17, 2019

This request might be now reconsidered in light of the add_figure support. There's now a pattern of providing convenience functions that rely on specialized encoding. It seems these conveniences are implemented at the SummaryWriter level, which keeps them out of the lower layers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants