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

Tensor sizes are mismatched when matmul in test.py #3

Closed
tan5o opened this issue Oct 10, 2020 · 1 comment
Closed

Tensor sizes are mismatched when matmul in test.py #3

tan5o opened this issue Oct 10, 2020 · 1 comment

Comments

@tan5o
Copy link

tan5o commented Oct 10, 2020

python /home/koya/git/GanHand/test.py --dataset_mode ycb_affordances_complete_scene --name ganhand_pretrained --load_epoch 13 --data_dir /home/koya/git/YCB_Affordance --mano_dir /home/koya/git/manopth/mano/models

I ran test.py based on README.md.
But, I encountered an error.

Traceback (most recent call last):
  File "/home/koya/git/GanHand/test.py", line 443, in <module>
    Test()
  File "/home/koya/git/GanHand/test.py", line 257, in __init__
    self._display_visualizer_test(20, self._total_steps)
  File "/home/koya/git/GanHand/test.py", line 321, in _display_visualizer_test
    self._model.forward(keep_data_for_visuals=True)
  File "/home/koya/git/GanHand/models/ganhand.py", line 222, in forward
    handfullpose_list, touching_indexs, loss_distance, loss_angle, loss_angle_2ndjoint, loss_angle_3rdjoint = fk.optimize_hand(handfullpose[i].unsqueeze(0), R[i].unsqueeze(0), T[i].unsqueeze(0), self._input_obj_resampled_verts[i][self._input_object_id[i]])
  File "/home/koya/git/GanHand/utils/forward_kinematics_3dof.py", line 491, in optimize_hand
    meshes, _ = get_hand(handfullpose_repeated, R.repeat(num_samples, 1), T.repeat(num_samples, 1))
  File "/home/koya/git/GanHand/utils/forward_kinematics_3dof.py", line 297, in get_hand
    MANO.th_posedirs, th_pose_map.transpose(0, 1)).permute(2, 0, 1)
RuntimeError: size mismatch, m1: [2334 x 135], m2: [144 x 51] at /tmp/pip-req-build-ocx5vxk7/aten/src/THC/generic/THCTensorMathBlas.cu:290

I saw around code, however, I have no idea.
Do you know the cause?

Where the error occurred

    # NOTE: GET HAND MESH VERTICES: 778 vertices in 3D
    # th_v_posed -> [batchsize, 778, 3]
    th_v_posed = th_v_shaped + torch.matmul(
        MANO.th_posedirs, th_pose_map.transpose(0, 1)).permute(2, 0, 1)
@tan5o tan5o changed the title Tensor size mismatch when matmul in test.py Tensor sizes are mismatched when matmul in test.py Oct 10, 2020
@tan5o
Copy link
Author

tan5o commented Oct 25, 2020

I solved it.
Use manopth at this commit

hassony2/manopth@246a4e3

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

1 participant