open-mmlab / mmagic

OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox. Unlock the magic 🪄: Generative-AI (AIGC), easy-to-use APIs, awsome model zoo, diffusion models, for text-to-image generation, image/video restoration/enhancement, etc.
https://mmagic.readthedocs.io/en/latest/
Apache License 2.0
6.95k stars 1.06k forks source link

[Bug] AttributeError: 'EditDDIMScheduler' object has no attribute 'sample_timestep' #2140

Open BEARSXXX opened 7 months ago

BEARSXXX commented 7 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmagic

Environment

11

Reproduces the problem - code sample

1

Reproduces the problem - command or script

1

Reproduces the problem - error message

  File "D:\Anaconda\envs\mmagic\lib\site-packages\mmengine\runner\loops.py", line 309, in run_iter
    outputs = self.runner.model.train_step(
  File "D:\mmagic-main\mmagic-main\mmagic\models\editors\guided_diffusion\adm.py", line 289, in train_step
    timestep = self.diffusion_scheduler.sample_timestep()
AttributeError: 'EditDDIMScheduler' object has no attribute 'sample_timestep'

Additional information

是不是下面的代码没写全?

    def training_loss(self, model, x_0, t):
        raise NotImplementedError(
            'This function is supposed to return '
            'a dict containing loss items giving sampled x0 and timestep.')

    def sample_timestep(self):
        raise NotImplementedError