The Wayback Machine - https://web.archive.org/web/20201105084502/https://github.com/yunjey/pytorch-tutorial/issues/198
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

Tensorboard image broken: scipy.misc.toimage deprecated #198

Open
biggoron opened this issue Dec 4, 2019 · 0 comments
Open

Tensorboard image broken: scipy.misc.toimage deprecated #198

biggoron opened this issue Dec 4, 2019 · 0 comments

Comments

@biggoron
Copy link

@biggoron biggoron commented Dec 4, 2019

With the latest version of scipy.misc, scipy.misc.toimage is no longer available. To load and save an image as png we now have to use PIL, breaking tensorboard image summary.

Here is how I fixed the bug:
1./ At the end of main.py, log a uint8 image
logger.image_summary(tag, (images * 255).astype(np.uint8), step+1)
2./ In Logger class, package image as bytes with the PIL library (mode="L" read image as B&W uint8 image)
from PIL import Image
Image.fromarray(img, mode='L').save(s, "PNG")

[EDIT] I am not used to contributing to other people code but if you teach me how to do it I can fix the bug myself :)

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.