mindspore-lab / mindone

one for all, Optimal generator with No Exception
Apache License 2.0
328 stars 62 forks source link

diffusers/text_to_image/train_text_to_imager.py vae的结果是NAN #488

Closed ultranationalism closed 1 month ago

ultranationalism commented 1 month ago

Thanks for sending an issue! Here are some tips for you:

If this is your first time, please read our contributor guidelines: https://github.com/mindspore-ai/mindspore/blob/master/CONTRIBUTING.md

Hardware Environment | 硬件环境

Software Environment | 软件环境

Describe the current behavior | 目前输出

e.g. the current output is xxx/ the error is xxx/ latents = self.vae.diag_gauss_dist.sample(self.vae.encode(pixel_values.to(self.weight_dtype))[0]) 后,lantents全为NAN

Describe the expected behavior | 期望输出

please describe expected outputs or functions you want to have: 正常的转换image为latents

Steps to reproduce the issue | 复现报错的步骤

使用vae为runwayml/stable-diffusion-v1-5中的任何一个safetensors的vae均会导致这个结果,无论是fp32 vae还是fp16vae,--mixed_precision为no或者fp16均会导致latents为NAN

Related log / screenshot | 完整日志

Special notes for this issue | 其他信息