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

[Bug]: Attribute error #5

Closed
2 tasks done
thavocado opened this issue Jul 18, 2023 · 8 comments
Closed
2 tasks done

[Bug]: Attribute error #5

thavocado opened this issue Jul 18, 2023 · 8 comments

Comments

@thavocado
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

Have you read FAQ on README?

  • I have updated WebUI and this extension to the latest version

What happened?

An AttributeError is thrown.

Steps to reproduce the problem

Press generate while extension is enabled

What should have happened?

It should not throw the error

Commit where the problem happens

webui: v1.4.1
extension: e8c88a4

What browsers do you use to access the UI ?

No response

Command Line Arguments

set COMMANDLINE_ARGS=--listen --api --enable-insecure-extension-access

Console logs

2023-07-18 19:38:03,650 - AnimateDiff - INFO - Removing motion module from SD1.5 UNet input blocks.
Error running postprocess: C:\Users\TooDee\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py
Traceback (most recent call last):
  File "C:\Users\TooDee\stable-diffusion-webui\modules\scripts.py", line 404, in postprocess
    script.postprocess(p, processed, *script_args)
  File "C:\Users\TooDee\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py", line 142, in postprocess
    self.remove_motion_modules(p)
  File "C:\Users\TooDee\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py", line 122, in remove_motion_modules
    unet.input_blocks[unet_idx].pop(-1)
  File "C:\Users\TooDee\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1207, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'TimestepEmbedSequential' object has no attribute 'pop'


### Additional information

_No response_
@mbazaczek
Copy link

I am experiencing the same error, seems like there is an issue when unloading the motion module. Restarting the whole webui.bat allows for one successful generation, afterwards I'm getting weird noise unless I restart the webui.bat.

@IntellectzProductions
Copy link

I am experiencing the same error, seems like there is an issue when unloading the motion module. Restarting the whole webui.bat allows for one successful generation, afterwards I'm getting weird noise unless I restart the webui.bat.

yes. this is annoying. For me my generation doesn't even make a gif.

@continue-revolution
Copy link
Owner

Please give me a screenshot of your webui, otherwise I cannot reproduce your error on my side.

@AkosseDeVamp
Copy link

Please give me a screenshot of your webui, otherwise I cannot reproduce your error on my side.

Hello, I'm not the OP but I have the same error. The Webui is up-to-date and I installed this addon about 30 minutes ago so I assume this is as well. I have included a screenshot, hope it helps.

msedge_IidFxkI2G3

@antispamtutoruser123
Copy link

Yep same error and same symptoms with all images going to garbage after first run.

@antispamtutoruser123
Copy link

I fixed it by reinstalling torch. Check for error messages on the window where you launched webui

@remixer-dec
Copy link
Contributor

remixer-dec commented Sep 6, 2023

For old pytorch there is a solution:

def _pop(self, key):
    v = self[key]
    del self[key]
    return v

def _insert(self, index, module):
    n = len(self._modules)
    if not (-n <= index <= n):
        raise IndexError(
            f'Index out of range: {index}')
    if index < 0:
        index += n
    for i in range(n, index, -1):
        self._modules[str(i)] = self._modules[str(i - 1)]
    self._modules[str(index)] = module
    return self

TimestepEmbedSequential.pop = _pop
TimestepEmbedSequential.insert = _insert

in scripts/animatediff.py somewhere after imports
But it only works for 1 run

@continue-revolution
Copy link
Owner

I will close this issue for now. If you meet this problem again, please update your pytorch by running webui with --reinstall-torch (if I remember correctly)

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

7 participants