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

Tensor error for basic example usage #136

Open
abasu0713 opened this issue Aug 23, 2023 · 3 comments
Open

Tensor error for basic example usage #136

abasu0713 opened this issue Aug 23, 2023 · 3 comments

Comments

@abasu0713
Copy link

Can't seem to run the basic example usage from here. Throws the following error:

`

AttributeError Traceback (most recent call last)
in <cell line: 40>()
38
39 # stage 3
---> 40 image = stage_3(prompt=prompt, image=image, generator=generator, noise_level=100).images
41 pt_to_pil(image)[0].save("./if_stage_III.png")

4 frames
/usr/local/lib/python3.10/dist-packages/diffusers/utils/pil_utils.py in numpy_to_pil(images)
41 if images.ndim == 3:
42 images = images[None, ...]
---> 43 images = (images * 255).numpy().round().astype("uint8")
44 if images.shape[-1] == 1:
45 # special case for grayscale (single channel) images

AttributeError: 'Tensor' object has no attribute 'astype'

@adavies25
Copy link

I'm getting the same error. I have diffusers v0.20.2.

@adavies25
Copy link

adavies25 commented Sep 1, 2023

I avoided the error by rolling back diffusers library with "pip install diffusers==0.16" however, the final output image was not what the prompt stated. This colab page does work however here

@abasu0713
Copy link
Author

abasu0713 commented Sep 1, 2023

Thank you @adavies25. I got it working too! The stage 3 is where the upscaler is being used.. And that was where it was failing. I was able to use it simply with my own diffuser. And building the diffuser library from source.
But this bug should remain Open since the documentation is wrong.. It doesn't mention anything about using an old diffuser version. Just my opinion

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