jyunlee / InterHandGen

InterHandGen: Two-Hand Interaction Generation via Cascaded Reverse Diffusion (CVPR 2024)
https://jyunlee.github.io/projects/interhandgen/
60 stars 3 forks source link

run-time error (in computing) #2

Open llll5555 opened 8 months ago

llll5555 commented 8 months ago

Thanks for your code, when I run interhand.py I get a dimension mismatch, theoretically, there shouldn't be this error, how to fix it please, thanks!

ERROR - interhandgen.py - 2024-04-02 00:09:05,236 - Traceback (most recent call last): File "/mnt/e/Lwork/two-hand/Code/InterHandGen/interhandgen.py", line 147, in main runner.train() File "/mnt/e/Lwork/two-hand/Code/InterHandGen/runners/diffhand.py", line 367, in train data, gt_anchor_verts, gt_add_verts, gt_anchor_joints, gt_add_joints, anc_valid, add_valid = self.mano_forward_gt(data) File "/mnt/e/Lwork/two-hand/Code/InterHandGen/runners/diffhand.py", line 272, in mano_forward_gt add_handV = add_handV - add_handJ[:, 9, :].unsqueeze(1) + rel_trans.unsqueeze(1) RuntimeError: The size of tensor a (778) must match the size of tensor b (3) at non-singleton dimension 1

jyunlee commented 8 months ago

Hello, thanks for your interest in our work! Did you follow the data preparation steps listed here ( https://github.com/jyunlee/InterHandGen?tab=readme-ov-file#data-preparation)?

If you're still getting the error after executing the above steps, please let me know the shapes of your add_handV, add_handJ, and rel_trans tensors.

llll5555 commented 8 months ago

add_handV, add_handJ, and rel_trans tensors. add_handV [1,778,3] add_handJ[1,21,3],rel_trans[3]

jyunlee commented 8 months ago

Seems like the batch dimension of rel_trans has been squeezed. Have you tried (1) increasing your batch size to >1 or (2) unsqueeze the batch dimension of rel_trans (i.e., rel_trans[None, None, :])?