johannakarras / DreamPose

Official implementation of "DreamPose: Fashion Image-to-Video Synthesis via Stable Diffusion"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error in demo

DmitriyPin opened this issue · comments

I followed the instructions to download and unzip the pretrained models and the input poses, but when I ran demo on my windows box, I am getting the following run time error. Let me know if I am missing something in my setup

$ python test.py --epoch 499 --folder demo/custom-chkpts --pose_folder demo/sample/poses --key_frame_path demo/sample/key_frame.png --s1 8 --s2 3 --n_steps 100 --output_dir demo/sample/results --custom_vae demo/custom-chkpts/vae_1499.pth
Traceback (most recent call last):
File "test.py", line 48, in
unet = get_unet('CompVis/stable-diffusion-v1-4', "ebb811dd71cdc38a204ecbdd6ac5d580f529fd8c", resolution=512)
File "C:\repo\ml\DreamPose\models\unet_dual_encoder.py", line 30, in get_unet
unet.conv_in.weight[:, 4:] = torch.zeros(unet.conv_in.weight[:, 3:].shape) # new weights initialized to zero
RuntimeError: The expanded size of the tensor (10) must match the existing size (11) at non-singleton dimension 1. Target sizes: [320, 10, 3, 3]. Tensor sizes: [320, 11, 3, 3]

rewrite "unet.conv_in.weight[:, 4:] = torch.zeros(unet.conv_in.weight[:, 3:].shape) # new weights initialized to zero" to
unet.conv_in.weight[:, 4:] = torch.zeros(unet.conv_in.weight[:, 4:].shape). This issue was pointed out by other user and the authors said they have fixed it, obviously, they didn't

HUGE thank you. That resolved the issue