Skip to content

Textual inversion training notebook, 'AutoencoderKLOutput' object has no attribute 'sample' #435

@crypticsymmetry

Description

@crypticsymmetry

Describe the bug

Been getting this error error_Textual_Inv was working last night... I've tried restarting/refreshing/New notebook, etc no luck. How do I fix this? thanks!

Reproduction

No response

Logs

AttributeError                            Traceback (most recent call last)
<ipython-input-21-7e0131ac8691> in <module>
      1 import accelerate
----> 2 accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet))

1 frames
<ipython-input-20-325883ee7544> in training_function(text_encoder, vae, unet)
     61             with accelerator.accumulate(text_encoder):
     62                 # Convert images to latent space
---> 63                 latents = vae.encode(batch["pixel_values"]).sample().detach()
     64                 latents = latents * 0.18215
     65 

AttributeError: 'AutoencoderKLOutput' object has no attribute 'sample'

System Info

colab notebook

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions