Dear author,
Thanks for your project, I want to train with smplx with smplx parameters estimated by both default romp in Instant and Refit , then I met below erros.
i use the code below to process the dynvideo_male data you provide and got this error yet.
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 0 for tensor number 4 in the list.
`smpl_model = smplx.SMPLX(model_path='../assets/smpl_files/smplx', gender=gender, use_pca=False, num_pca_comps=45, flat_hand_mean=True, batch_size=1)
smpl_data = torch.load(os.path.join(data_path, 'smpl_parms.pth'), weights_only=True)
cano_dir = os.path.join(data_path,)
live_smpl = smpl_model.forward(
betas=smpl_data['beta'][0][None],
transl=torch.tensor([[0, 0.35, 0]]),
global_orient=smplx_cpose_param[:, :3],
body_pose=smplx_cpose_param[:, 3:66],
jaw_pose=smplx_cpose_param[:, 66:69],
leye_pose=smplx_cpose_param[:, 69:72],
reye_pose=smplx_cpose_param[:, 72:75],
left_hand_pose=smplx_cpose_param[:, 75:120],
right_hand_pose=smplx_cpose_param[:, 120:]
)
ori_vertices = live_smpl.vertices.detach().cpu().numpy().squeeze()
joint_mat = live_smpl.A
print(joint_mat.shape)
torch.save(joint_mat, os.path.join(cano_dir, 'smplx_cano_joint_mat.pth'))
mesh = trimesh.Trimesh(ori_vertices, smpl_model.faces, process=False)
mesh.export(os.path.join(cano_dir, 'cano_smplx.obj'))`

Training progress: 0%| | 0/3300 [00:00<?, ?it/s]global_orient shape: torch.Size([2, 3]) [18/02 19:16:47]
body_pose shape: torch.Size([2, 63]) [18/02 19:16:47]
jaw_pose shape: torch.Size([2, 3]) [18/02 19:16:47]
leye_pose shape: torch.Size([2, 3]) [18/02 19:16:47]
reye_pose shape: torch.Size([2, 0]) [18/02 19:16:47]
left_hand_pos shape: torch.Size([2, 0]) [18/02 19:16:47]
right_hand_pose shape: torch.Size([2, 0]) [18/02 19:16:47]
Traceback (most recent call last):
File "/home/sysu/Desktop/animate/GaussianAvatar/train.py", line 185, in
train(lp.extract(args), np.extract(args), op.extract(args), args.save_epochs, args.checkpoint_epochs)
File "/home/sysu/Desktop/animate/GaussianAvatar/train.py", line 74, in train
image, points, offset_loss, geo_loss, scale_loss = avatarmodel.train_stage1(batch_data, first_iter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sysu/Desktop/animate/GaussianAvatar/model/avatar_model.py", line 335, in train_stage1
live_smpl = self.smpl_model.forward(betas = self.betas,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sysu/Desktop/animate/GaussianAvatar/submodules/smplx/body_models.py", line 1211, in forward
full_pose = torch.cat([global_orient.reshape(-1, 1, 3),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 0 for tensor number 4 in the list.
Dear author,
Thanks for your project, I want to train with smplx with smplx parameters estimated by both default romp in Instant and Refit , then I met below erros.
i use the code below to process the dynvideo_male data you provide and got this error yet.
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 0 for tensor number 4 in the list.
`smpl_model = smplx.SMPLX(model_path='../assets/smpl_files/smplx', gender=gender, use_pca=False, num_pca_comps=45, flat_hand_mean=True, batch_size=1)
smpl_data = torch.load(os.path.join(data_path, 'smpl_parms.pth'), weights_only=True)
cano_dir = os.path.join(data_path,)
Training progress: 0%| | 0/3300 [00:00<?, ?it/s]global_orient shape: torch.Size([2, 3]) [18/02 19:16:47]
body_pose shape: torch.Size([2, 63]) [18/02 19:16:47]
jaw_pose shape: torch.Size([2, 3]) [18/02 19:16:47]
leye_pose shape: torch.Size([2, 3]) [18/02 19:16:47]
reye_pose shape: torch.Size([2, 0]) [18/02 19:16:47]
left_hand_pos shape: torch.Size([2, 0]) [18/02 19:16:47]
right_hand_pose shape: torch.Size([2, 0]) [18/02 19:16:47]
Traceback (most recent call last):
File "/home/sysu/Desktop/animate/GaussianAvatar/train.py", line 185, in
train(lp.extract(args), np.extract(args), op.extract(args), args.save_epochs, args.checkpoint_epochs)
File "/home/sysu/Desktop/animate/GaussianAvatar/train.py", line 74, in train
image, points, offset_loss, geo_loss, scale_loss = avatarmodel.train_stage1(batch_data, first_iter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sysu/Desktop/animate/GaussianAvatar/model/avatar_model.py", line 335, in train_stage1
live_smpl = self.smpl_model.forward(betas = self.betas,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sysu/Desktop/animate/GaussianAvatar/submodules/smplx/body_models.py", line 1211, in forward
full_pose = torch.cat([global_orient.reshape(-1, 1, 3),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 0 for tensor number 4 in the list.