You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a RuntimeError while running the transfer_model script. The error occurs in the apply_deformation_transfer function within the def_transfer.py file. Specifically, the torch.einsum operation fails due to a dimension mismatch.
Error Traceback
0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/ml-monorepo/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/ubuntu/miniconda3/envs/ml-monorepo/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/ubuntu/app/ml-projects-monorepo/smplx/transfer_model/__main__.py", line 104, in <module>
main()
File "/home/ubuntu/app/ml-projects-monorepo/smplx/transfer_model/__main__.py", line 84, in main
var_dict = run_fitting(
File "/home/ubuntu/app/ml-projects-monorepo/smplx/transfer_model/transfer_model.py", line 280, in run_fitting
def_vertices = apply_deformation_transfer(def_matrix, vertices, faces)
File "/home/ubuntu/app/ml-projects-monorepo/smplx/transfer_model/utils/def_transfer.py", line 78, in apply_deformation_transfer
def_vertices = torch.einsum('mn,bni->bmi', [def_matrix, vertices])
File "/home/ubuntu/miniconda3/envs/ml-monorepo/lib/python3.8/site-packages/torch/functional.py", line 381, in einsum
return einsum(equation, *_operands)
File "/home/ubuntu/miniconda3/envs/ml-monorepo/lib/python3.8/site-packages/torch/functional.py", line 386, in einsum
return _VF.einsum(equation, operands) # type: ignore[attr-defined]
RuntimeError: einsum(): subscript n has size 11437 for operand 1 which does not broadcast with previously seen size 10475
Steps to Reproduce
Run the transfer_model script with the current configuration. python -m transfer_model --exp-cfg config_files/smplx2smpl.yaml
Observe the RuntimeError in the console output.
Expected Behavior
The torch.einsum operation should execute without any dimension mismatch errors.
Actual Behavior
The torch.einsum operation fails due to a dimension mismatch between def_matrix and vertices.
Debug Information
Here are the shapes of the tensors involved in the torch.einsum operation:
def_matrix shape: torch.Size([6890, 10475])
vertices shape: torch.Size([1, 11437, 3])
Relevant Code
Excerpt from def_transfer.py:
defapply_deformation_transfer(
def_matrix: Tensor,
vertices: Tensor,
faces: Tensor,
use_normals=False
) ->Tensor:
''' Applies the deformation transfer on the given meshes '''ifuse_normals:
raiseNotImplementedErrorelse:
# Debug prints to check the shapesprint(f"def_matrix shape: {def_matrix.shape}")
print(f"vertices shape: {vertices.shape}")
def_vertices=torch.einsum('mn,bni->bmi', [def_matrix, vertices])
returndef_vertices
Additional Context
The issue seems to be caused by a mismatch in the dimensions of def_matrix and vertices. The second dimension of def_matrix (10475) does not match the second dimension of vertices (11437). This discrepancy needs to be resolved to ensure the torch.einsum operation can execute successfully.
Issue Description
I encountered a
RuntimeError
while running thetransfer_model
script. The error occurs in theapply_deformation_transfer
function within thedef_transfer.py
file. Specifically, thetorch.einsum
operation fails due to a dimension mismatch.Error Traceback
Steps to Reproduce
transfer_model
script with the current configuration.python -m transfer_model --exp-cfg config_files/smplx2smpl.yaml
RuntimeError
in the console output.Expected Behavior
The
torch.einsum
operation should execute without any dimension mismatch errors.Actual Behavior
The
torch.einsum
operation fails due to a dimension mismatch betweendef_matrix
andvertices
.Debug Information
Here are the shapes of the tensors involved in the
torch.einsum
operation:def_matrix shape: torch.Size([6890, 10475])
vertices shape: torch.Size([1, 11437, 3])
Relevant Code
Excerpt from
def_transfer.py
:Additional Context
The issue seems to be caused by a mismatch in the dimensions of
def_matrix
andvertices
. The second dimension ofdef_matrix
(10475) does not match the second dimension ofvertices
(11437). This discrepancy needs to be resolved to ensure thetorch.einsum
operation can execute successfully.I used this config file:
Environment
Labels
The text was updated successfully, but these errors were encountered: