microsoft / DPSDA

[ICLR 2024] Generating DP Synthetic Data without Training
MIT License
77 stars 8 forks source link

FutureWarning: Passing `image` as torch tensor with value range in [-1,1] is deprecated. #1

Closed mufeili closed 1 year ago

mufeili commented 1 year ago

Thank you for sharing this great codebase! When I tried the quick example for Cat Cookie with scripts/main_stable_diffusion_cookie.sh, I noticed a warning from the diffusers package as follows.

Found 100 images in the folder /tmp/result_cookie
FID result_cookie : 100%|█████████████████████████████████████████████████████████| 1/1 [00:02<00:00,  2.73s/it]
07/04/2023 12:40:03 PM [MainThread  ] [INFO ]  fid=86.46057094437475
07/04/2023 12:40:03 PM [MainThread  ] [INFO ]  t=1
07/04/2023 12:40:03 PM [MainThread  ] [INFO ]  Running image variation
  0%|                                                                                     | 0/8 [00:00<?, ?it/s/
.../python3.8/site-packages/diffusers/image_processor.py:204: FutureWarn
ing: Passing `image` as torch tensor with value range in [-1,1] is deprecated. The expected value range for imag
e tensor is [0,1] when passing as pytorch tensor or numpy Array. You passed `image` with value range [-1.0,1.0]
  warnings.warn(

Is this something that I should be careful? Was this warning already there in your experiments? If not, maybe this is due to a new release of diffusers. In that case, I will greatly appreciate it if you can share the version you used for diffusers.

In case it helps, this issue might be related to https://github.com/huggingface/diffusers/issues/3876. Thank you very much for your time.

fjxmlzn commented 1 year ago

Yes, I have seen this error. I think it is raised due to image parameter to StableDiffusionImg2ImgPipeline which we used for image variations. I think the desired range for image in this API is indeed [-1,1] so we can ignore this warning.

mufeili commented 1 year ago

Got it. Thanks for the prompt response!