Skip to content

help me solve this tensor mismatch problem #1

@Bhavik-h-patel-nkb

Description

@Bhavik-h-patel-nkb

RuntimeError Traceback (most recent call last)
Cell In[5], line 3
1 garment_path = "/home/nkb-playtech/Desktop/bhavik/inpainting_v12/assets/images/garment_resized.png"
----> 3 result = model.tryon_video(
4 video_path="/home/nkb-playtech/Desktop/bhavik/inpainting_v12/assets/videos/video_7sec_resized_swiftTry.mp4",
5 mask_video_path="/home/nkb-playtech/Desktop/bhavik/inpainting_v12/assets/videos/mask_7sec_resized_swiftTry.mp4",
6 pose_video_path="/home/nkb-playtech/Desktop/bhavik/inpainting_v12/assets/videos/pose_7sec_resized_swiftTry.mp4",
7 save_dir="/home/nkb-playtech/Desktop/bhavik/inpainting_v12/outputs",
8 ref_cloth_image=garment_path,
9 masked_video_path="/home/nkb-playtech/Desktop/bhavik/inpainting_v12/assets/videos/masked_7sec_resized_swiftTry.mp4",
10 clip_length=210
11 )

File ~/Desktop/bhavik/inpainting_v12/SwiftTry/inference.py:125, in TryOnController.tryon_video(self, ref_cloth_image, video_path, masked_video_path, mask_video_path, pose_video_path, clip_length, num_inference_steps, cfg, seed, repaint, save_dir, overlap_value)
121 scheduler = DDIMScheduler(**sched_kwargs)
122 # inverse_scheduler = DDIMInverseScheduler(**sched_kwargs)
123
124 # load pretrained weights
--> 125 denoising_unet.load_state_dict(
126 torch.load(self.config.denoising_unet_path, map_location="cpu"),
127 strict=False,
128 )
129 reference_unet.load_state_dict(
130 torch.load(self.config.reference_unet_path, map_location="cpu"),
131 )
132 pose_guider.load_state_dict(
133 torch.load(self.config.pose_guider_path, map_location="cpu"),
134 )

File ~/anaconda3/envs/swift_try/lib/python3.10/site-packages/torch/nn/modules/module.py:2635, in Module.load_state_dict(self, state_dict, strict, assign)
2627 error_msgs.insert(
2628 0,
2629 "Missing key(s) in state_dict: {}. ".format(
2630 ", ".join(f'"{k}"' for k in missing_keys)
2631 ),
2632 )
2634 if len(error_msgs) > 0:
-> 2635 raise RuntimeError(
2636 "Error(s) in loading state_dict for {}:\n\t{}".format(
2637 self.class.name, "\n\t".join(error_msgs)
2638 )
2639 )
2640 return _IncompatibleKeys(missing_keys, unexpected_keys)

RuntimeError: Error(s) in loading state_dict for UNet3DConditionModel:
size mismatch for conv_in.weight: copying a param with shape torch.Size([320, 9, 3, 3]) from checkpoint, the shape in current model is torch.Size([320, 4, 3, 3]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions