enghock1 / Real-Time-2D-and-3D-Hand-Pose-Estimation

Real-Time 2D and 3D Hand Pose Estimation from RGB Image
GNU General Public License v2.0
48 stars 15 forks source link

runtime error when testing with webcam #8

Open thunder95 opened 3 years ago

thunder95 commented 3 years ago

Traceback (most recent call last): File "7.real_time_3D_handposeestimation.py", line 71, in , est_pose_uv, est_pose_cam_xyz = model(frame_device, K, pose_scale) File "/soft/Anaconda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, kwargs) File "/home/Downloads/hand_pose/Real-Time-2D-and-3D-Hand-Pose-Estimation/hand_shape_pose/model/pose_mlp_network.py", line 90, in forward est_pose_rel_depth = self.mlp(est_hm_list, encoding) # This relative depth is scale invariant File "/f/soft/Anaconda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "/home/Downloads/hand_pose/Real-Time-2D-and-3D-Hand-Pose-Estimation/hand_shape_pose/model/net_mlp.py", line 36, in forward x = self.feat_net(hm_list, encoding_list) File "/f/hsoft/Anaconda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/home/hl/Downloads/hand_pose/Real-Time-2D-and-3D-Hand-Pose-Estimation/hand_shape_pose/model/net_hm_feat_mesh.py", line 205, in forward out = x.view(x.size(0), -1) RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

and btw, how fast is this inference processs?

roachsinai commented 3 years ago

Same iusse here.

Alandougherty commented 3 years ago

changing the file hand_shape_pose\model\net_hm_feat_mesh.py out = x.view(x.size(0), -1) to out = x.contiguous().view(x.size(0), -1)

seems to avoid this error. But possibly not the best solution, as I now have additional errors after running the hand tracking for a while.