Doubiiu / DynamiCrafter

[ECCV 2024, Oral] DynamiCrafter: Animating Open-domain Images with Video Diffusion Priors
https://doubiiu.github.io/projects/DynamiCrafter/
Apache License 2.0
2.46k stars 197 forks source link

AttributeError: 'VisionTransformer' object has no attribute 'input_patchnorm' #40

Closed wimmerth closed 6 months ago

wimmerth commented 6 months ago

I get the following error message when I try to execute the method. Do you have any idea where this could be coming from?

"dynamicrafter/lvdm/modules/encoders/condition.py", line 339, in forward
    z = self.encode_with_vision_transformer(image)
"/dynamicrafter/lvdm/modules/encoders/condition.py", line 346, in encode_with_vision_transformer
    if self.model.visual.input_patchnorm:
AttributeError: 'VisionTransformer' object has no attribute 'input_patchnorm'
wimmerth commented 6 months ago

Of course, modifying the condition to if hasattr(self.model.visual, "input_patchnorm") and self.model.visual.input_patchnorm: does work but it might be good to see whether others have this issue as well and/or whether this is an issue on my side with the open_clip model etc.

Doubiiu commented 6 months ago

Hi. Maybe the version of open_clip does not match? I know we set open_clip_torch==2.22.0 in the requirements.txt, but could you try to install open_clip_torch==2.17.1 and see if the issue can be fixed.

wimmerth commented 6 months ago

Hi, you're right, the open_clip version is probably the reason. I was using my own environment for development. However, it might be interesting for you to know that I was using open-clip-torch==2.24.0, so it seems they removed or renamed this. Thanks for your help, I'll close this issue.

Doubiiu commented 6 months ago

Thanks for letting me know this. Have a nice day~