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

black image occurs #2

Open
tianqyun111 opened this issue Sep 6, 2024 · 3 comments
Open

black image occurs #2

tianqyun111 opened this issue Sep 6, 2024 · 3 comments

Comments

@tianqyun111
Copy link

When processing some pictures, most of them are normal,
but a few of them will have a black screen and an error message:
image_processor.py:111: RuntimeWarning: invalid value encountered in cast, images = (images * 255).round().astype("uint8")

@tianqyun111
Copy link
Author

When processing some pictures, most of them are normal, but a few of them will have a black screen and an error message: image_processor.py:111: RuntimeWarning: invalid value encountered in cast, images = (images * 255).round().astype("uint8")

solved it. Because of the unstable calculation of fp16,at inversion preprocess it will calculate [nan,nan,nan] tensor, which leads to the black image,change it to fp32, and solve it

@mohammadalirezaee
Copy link

mohammadalirezaee commented Sep 14, 2024

Hi @tianqyun111 .
Thanks for sharing your experience.
do you think i can use bf16 instead of fp32?
best regard.

@tianqyun111
Copy link
Author

Hi @tianqyun111 . Thanks for sharing your experience. do you think i can use bf16 instead of fp32? best regard.

yeah,i think you can try

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

2 participants