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

run align_to_SMPL_seq.py script error #20

Open
2382752230 opened this issue Sep 28, 2024 · 4 comments
Open

run align_to_SMPL_seq.py script error #20

2382752230 opened this issue Sep 28, 2024 · 4 comments

Comments

@2382752230
Copy link

Hi! Thanks for your great work!

I have an error running the align_to_SMPL_seq.py script. Does this script require the smpl sequence format? This works fine when running the example, but the following error occurs when processing AMASS/CMU/41/41_02_poses.npz.

Running batch optimization: 50%|█████ | 1/2 [04:50<04:50, 290.76s/it]
Traceback (most recent call last):
File "/home/oneday/SKEL/examples/align_to_SMPL_seq.py", line 60, in
skel_seq = skel_fitter.run_fit(smpl_seq['trans'],
File "/home/oneday/SKEL/skel/alignment/aligner.py", line 119, in run_fit
betas, poses, trans, verts = self._fit_batch(body_params, i, i_start, i_end)
File "/home/oneday/SKEL/skel/alignment/aligner.py", line 202, in _fit_batch
smpl_output = self.smpl(betas=betas_smpl, body_pose=poses_smpl[:,3:], transl=trans_smpl, global_orient=poses_smpl[:,:3])
File "/home/oneday/anaconda3/envs/skel/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/oneday/anaconda3/envs/skel/lib/python3.8/site-packages/smplx/body_models.py", line 366, in forward
num_repeats = int(batch_size / betas.shape[0])
ZeroDivisionError: division by zero

@MarilynKeller
Copy link
Owner

Hi, this code requires SMPL or SMPLH sequences, make sure you downloaded the proper version from amass. The example sequence I provide is also from MU, did you manage to run the fit with that example sequence?

@2382752230
Copy link
Author

2382752230 commented Sep 29, 2024

Hi,thank you for your reply.
Yes, I run you provide sample (/home/oneday/SKEL/examples/samples/amass_seq/CMU_01_01.npz) can be normal operation. However, there are errors when running other amass sequences (the version downloaded from the AMASS website is SMPL-HG), such as running:/ home/oneday/aitviewer - skel/Data/AMASS/TotalCapture/s1/acting1_poses.npz appear the following error.

Running batch optimization: 50%|█████ | 1/2 [05:06<05:06, 306.01s/it]
Traceback (most recent call last):
File "/home/oneday/SKEL/examples/align_to_SMPL_seq.py", line 60, in
skel_seq = skel_fitter.run_fit(smpl_seq['trans'],
File "/home/oneday/SKEL/skel/alignment/aligner.py", line 118, in run_fit
betas, poses, trans, verts = self._fit_batch(body_params, i, i_start, i_end)
File "/home/oneday/SKEL/skel/alignment/aligner.py", line 201, in _fit_batch
smpl_output = self.smpl(betas=betas_smpl, body_pose=poses_smpl[:,3:], transl=trans_smpl, global_orient=poses_smpl[:,:3])
File "/home/oneday/anaconda3/envs/skel/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/oneday/anaconda3/envs/skel/lib/python3.8/site-packages/smplx/body_models.py", line 366, in forward
num_repeats = int(batch_size / betas.shape[0])
ZeroDivisionError: division by zero

Here and the content of the error is consistent with the above, you can try to run the AMASS/CMU/41/41_02_poses.npz sequences or AMASS TotalCapture/s1/acting1_poses.npz sequence? Does it work on your site?

@2382752230
Copy link
Author

Hi,I think the problem is the number of batches. In the code, the size of batch_size is 3000. When the smpl sequence length exceeds 3000, two batches are needed, and the size of betas will be (0,10) in the second batch, leading to an error.

I changed the size of batch_size to 5000 so that the smpl sequence can be processed in one batch, at which time the program can work normally.

Does the size of batch_size affect the registration performance? Can I set it to 5000 or 6000?

@MarilynKeller
Copy link
Owner

MarilynKeller commented Oct 1, 2024 via email

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

2 participants