bharat-b7 / RVH_Mesh_Registration

Code to fit SMPL model to scans
195 stars 22 forks source link

RuntimeError: mat1 and mat2 shapes cannot be multiplied (20670x300 and 10x1) #20

Open ccfco opened 1 year ago

ccfco commented 1 year ago

python smpl_registration/fit_SMPLHD.py data/mesh_1/scan.obj data/mesh_1/3D_pose.json data/mesh_1/ Using SMPL model for registration SMPL not specified, fitting SMPL now scan path ... data/mesh_1/scan.obj /root/miniconda3/envs/pytorch3d/lib/python3.8/site-packages/pytorch3d/io/utils.py:65: UserWarning: Faces have invalid indices warnings.warn("Faces have invalid indices") /root/miniconda3/envs/pytorch3d/lib/python3.8/site-packages/pytorch3d/io/obj_io.py:542: UserWarning: No mtl file provided warnings.warn("No mtl file provided") /disk3/user/AIGC/motion/RVH_Mesh_Registration/lib/smpl/smplpytorch/smplpytorch/pytorch/smpl_layer.py:58: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /opt/conda/conda-bld/pytorch_1646755903507/work/torch/csrc/utils/tensor_numpy.cpp:178.) torch.Tensor(smpl_data['betas'].r).unsqueeze(0)) /disk3/user/AIGC/motion/RVH_Mesh_Registration/lib/body_objectives.py:21: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at /opt/conda/conda-bld/pytorch_1646755903507/work/torch/csrc/utils/tensor_new.cpp:210.) body25_reg_torch = torch.sparse_coo_tensor(body25_reg.nonzero(), body25_reg.data, body25_reg.shape) 0%| | 0/30 [00:00<?, ?it/s]Optimizing SMPL global orientation Optimizing SMPL global orientation: 0%| | 0/30 [00:00<?, ?it/s] Traceback (most recent call last): File "smpl_registration/fit_SMPLHD.py", line 150, in main(args) File "smpl_registration/fit_SMPLHD.py", line 122, in main fitter.fit([args.scan_path], [args.pose_file], [args.smpl_pkl], args.gender, args.save_path) File "smpl_registration/fit_SMPLHD.py", line 25, in fit pose, betas, trans = super(SMPLDFitter, self).fit(scans, pose_files, gender, save_path) File "/disk3/user/AIGC/motion/RVH_Mesh_Registration/smpl_registration/fit_SMPLH.py", line 46, in fit self.optimize_pose_only(th_scan_meshes, smpl, pose_iterations, pose_steps_per_iter, th_pose_3d) File "/disk3/user/AIGC/motion/RVH_Mesh_Registration/smpl_registration/fit_SMPLH.py", line 146, in optimize_pose_only loss_dict = self.forward_step_pose_only(split_smpl, th_pose_3d, prior_weight) File "/disk3/user/AIGC/motion/RVH_Mesh_Registration/smpl_registration/fit_SMPLH.py", line 183, in forward_step_pose_only J, face, hands = smpl.get_landmarks() File "/disk3/user/AIGC/motion/RVH_Mesh_Registration/lib/smpl/wrapper_pytorch.py", line 185, in getlandmarks verts, , , = self.forward() File "/disk3/user/AIGC/motion/RVH_Mesh_Registration/lib/smpl/wrapper_pytorch.py", line 177, in forward verts, jtr, tposed, naked = self.smpl(self.pose, File "/root/miniconda3/envs/pytorch3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/disk3/user/AIGC/motion/RVH_Mesh_Registration/lib/smpl/smplpytorch/smplpytorch/pytorch/smpl_layer.py", line 111, in forward th_v_shaped = self.th_v_template + torch.matmul(self.th_shapedirs, th_betas.transpose(1, 0)).permute(2, 0, 1) RuntimeError: mat1 and mat2 shapes cannot be multiplied (20670x300 and 10x1)

donghaoye commented 1 year ago

--hands enable the smplh, not using smpl