Giter Club home page Giter Club logo

Comments (5)

jiamings avatar jiamings commented on June 4, 2024 1

@patrickvonplaten Can you take a look at this? This seems to be a diffusers issue. Thanks!

from ddim.

wyf0912 avatar wyf0912 commented on June 4, 2024 1

Dear all, thanks a lot for your reply.
I just update the version of diffusers to the same version (0.11.1), but I still meet the same problem. @patrickvonplaten

In [4]: diffusers.__version__
Out[4]: '0.11.1'

In [5]: from diffusers import DDIMPipeline
   ...: 
   ...: model_id = "google/ddpm-cifar10-32"
   ...: 
   ...: # load model and scheduler
   ...: ddim = DDIMPipeline.from_pretrained(model_id)
   ...: 
   ...: # run pipeline in inference (sample random noise and denoise)
   ...: image = ddim(num_inference_steps=50).images[0]
   ...: 
   ...: # save image
   ...: image.save("ddim_generated_image.png")
Fetching 4 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 24139.88it/s]
  0%|                                                                                                                                                                               | 0/50 [00:00<?, ?it/s]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-5a1f38721518> in <module>
      7 
      8 # run pipeline in inference (sample random noise and denoise)
----> 9 image = ddim(num_inference_steps=50).images[0]
     10 
     11 # save image

~/anaconda3/lib/python3.9/site-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     25         def decorate_context(*args, **kwargs):
     26             with self.clone():
---> 27                 return func(*args, **kwargs)
     28         return cast(F, decorate_context)
     29 

~/anaconda3/lib/python3.9/site-packages/diffusers/pipelines/ddim/pipeline_ddim.py in __call__(self, batch_size, generator, eta, num_inference_steps, use_clipped_model_output, output_type, return_dict)
    127             # eta corresponds to η in paper and should be between [0, 1]
    128             # do x_t -> x_t-1
--> 129             image = self.scheduler.step(
    130                 model_output, t, image, eta=eta, use_clipped_model_output=use_clipped_model_output, generator=generator
    131             ).prev_sample

~/anaconda3/lib/python3.9/site-packages/diffusers/schedulers/scheduling_ddpm.py in step(self, model_output, timestep, sample, generator, return_dict, **kwargs)
    257             " DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
    258         )
--> 259         predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
    260         if predict_epsilon is not None:
    261             new_config = dict(self.config)

~/anaconda3/lib/python3.9/site-packages/diffusers/utils/deprecation_utils.py in deprecate(take_from, standard_warn, *args)
     41         function = call_frame.function
     42         key, value = next(iter(deprecated_kwargs.items()))
---> 43         raise TypeError(f"{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`")
     44 
     45     if len(values) == 0:

TypeError: step in /home/yufei/anaconda3/lib/python3.9/site-packages/diffusers/schedulers/scheduling_ddpm.py line 258 got an unexpected keyword argument `eta`

from ddim.

patrickvonplaten avatar patrickvonplaten commented on June 4, 2024 1

I see! Sorry, I just noticed that the fix didn't make it into the last release: huggingface/diffusers#1932

Could you try to do:

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

And try again. We'll do a release next week so that you won't have to install from "main" anymore then.

Sorry about this!

from ddim.

oliverow avatar oliverow commented on June 4, 2024

Hi @wyf0912, I encountered the same issue. Have you by any chance figured out a fix for it? Thanks!

from ddim.

patrickvonplaten avatar patrickvonplaten commented on June 4, 2024

Sure!

@wyf0912, @oliverow could you try to update your diffusers version?

pip install --upgrade diffusers

I've tested:

from diffusers import DDIMPipeline

model_id = "google/ddpm-cifar10-32"

# load model and scheduler
ddim = DDIMPipeline.from_pretrained(model_id)

# run pipeline in inference (sample random noise and denoise)
image = ddim(num_inference_steps=50).images[0]

# save image
image.save("ddim_generated_image.png")

and it works as expected with:

import diffusers; print(diffusers.__verison__)  # 0.11.1

from ddim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.