diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

train_unconditional.py fails on call to evaluate()

Open jdk514 opened this issue 2 years ago • 3 comments

Describe the bug

On the first attempt to call evaluate() in the train_loop() function, the DDPMPipeline fails due to an incompatible output form the model.

This raises an AttributeError: 'dict' object has no attribute 'shape'

image

Reproduction

Currently encountered when running the collab notebook unaltered.

Logs

Logs included in bug description.

System Info

Google Collab Notebook found at https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb

jdk514 avatar Sep 21 '22 03:09 jdk514

Hi @jdk514! This is related to a bugfix that will be included in tomorrow's release: https://github.com/huggingface/diffusers/pull/570

Until then, please replace !pip install diffusers[training]=0.3.0 in the top cell with !pip install git+https://github.com/huggingface/diffusers.git#egg=diffusers[training] to use the latest version with the fix

anton-l avatar Sep 21 '22 14:09 anton-l

@anton-l @jdk514 did any of you manage to run it with:

!pip install git+https://github.com/huggingface/diffusers.git

It now shows this to me:

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

umarfm avatar Oct 01 '22 10:10 umarfm

@anton-l @jdk514 did any of you manage to run it with:

!pip install git+https://github.com/huggingface/diffusers.git

It now shows this to me:

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

In evaluate function, this worked for me: I changed .sample image

to .images

image

omer-dor avatar Oct 07 '22 10:10 omer-dor

Hi, I replaced !pip install diffusers[training]=0.3.0 with !pip install git+https://github.com/huggingface/diffusers.git, but I'm getting the following error:

Screenshot from 2022-10-16 01-40-28

It is the original notebook , I did not modify anything more than the line I mentioned.

It is worth mentioning that a few days ago I did the same procedure and it did not throw me this error.

LuisGalvezCarrasco avatar Oct 16 '22 05:10 LuisGalvezCarrasco

I'm going to help myself :), after some thought I realized that omitting the second argument tensor_format="pt" works fine.

I was afraid something would go wrong but it works fine, the training was successful and the generated images are consistent.

LuisGalvezCarrasco avatar Oct 16 '22 06:10 LuisGalvezCarrasco

@LuisGalvezCarrasco indeed, tensor_format has been deprecated in the latest version :) Updated the training notebook to diffusers==0.5.1: https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb

anton-l avatar Oct 17 '22 11:10 anton-l