GAP-LAB-CUHK-SZ / REC-MV

REC-MV: REconstructing 3D Dynamic Cloth from Monocular Videos (CVPR2023)
https://lingtengqiu.github.io/2023/REC-MV/
MIT License
298 stars 10 forks source link

Divide by zero error #13

Closed Zevrap-81 closed 1 year ago

Zevrap-81 commented 1 year ago

I am getting this error when i am running the example described in the readme file

bash ./scripts/large_pose/test_large_pose_fl.sh 0 anran_tic anran_tic_self_rotated
current 099 NRICP avg_update:0.00002 valid129082/139351: dis:0.1111, stiffness:0.0285, laplacian:0.1158, total:0.4894 laplacian_weight:250.0000, stiffness_weight:0.1000, static_sum:0.0000
Laplacian deformation it would be spent 1~3 minutes 
Traceback (most recent call last):
  File "infer_fl.py", line 260, in <module>
    colors_list,imgs_list,def1imgs_list,defVs_list, smpl_list, merge_imgs=optNet.infer_garment(garment_TmpVs,garment_Tmpfs, dataset.H, dataset.W,ratio,frame_ids,args.nColor,gts, args.rec_root)
  File "/home/engineer/networks/OptimGarmentNetwork.py", line 2965, in infer_garment
    self.registry_meshes = self.registration(fl_curve, TmpVs_list, Tmpfs_list, ratio, root)
  File "/home/engineer/networks/OptimGarmentNetwork.py", line 2453, in registration
    lap_curve_mesh = garment_engine['fl_init_registry'](source_fl_meshes = [garment_template], target_meshes = curve_meshes, source_type = [garment_name], target_fl_type = garment_fl_names, outlayer=True)
  File "/home/engineer/optimizer/lap_deform_optimizer.py", line 116, in __call__
    return self.fitting(inputs)
  File "/home/utils/common_utils.py", line 52, in wrapper
    ret = func(*f_args, **f_kwargs)
  File "/home/engineer/optimizer/lap_deform_optimizer.py", line 130, in fitting
    s_t_map_list, laplacian_matrix_list, vertices_list = self.__collect_data(inputs)
  File "/home/engineer/optimizer/lap_deform_optimizer.py", line 98, in __collect_data
    source_target_map_list = [source_garment_template.best_match(target_packed, source_garment_template.device, best_match_type) for source_garment_template in source_garment_templates]
  File "/home/engineer/optimizer/lap_deform_optimizer.py", line 98, in <listcomp>
    source_target_map_list = [source_garment_template.best_match(target_packed, source_garment_template.device, best_match_type) for source_garment_template in source_garment_templates]
  File "/home/engineer/utils/garment_structure.py", line 675, in best_match
    idx = torch.arange(0, target_bo.shape[0], (target_bo.shape[0]-1) /source_bo.shape[0]).long()
ZeroDivisionError: division by zero
lingtengqiu commented 1 year ago

could you give me more details about source_bo.shape[0]. I guess the error is may source_bo be zero tensor?

Zevrap-81 commented 1 year ago

I ran the same thing again, but I did not get the error. Only the run time is really slow.

lingtengqiu commented 1 year ago

The NICP is a optimization-based method, which needs some time to fit. However, it only runs once, after that, you do not run it NICP again!

Zevrap-81 commented 1 year ago

This time i got this error "unwished error n_inv_mask:(1:10000)" error

lingtengqiu commented 1 year ago

This is not the error, is a warning. It means, some transformation matrix can not be inverse.

This time i got this error "unwished error n_inv_mask:(1:10000)" error