zhan-xu / RigNet

Code for SIGGRAPH 2020 paper "RigNet: Neural Rigging for Articulated Characters"
GNU General Public License v3.0
1.34k stars 181 forks source link

Memory crash from compute_volumetric_geodesic.py #50

Closed artursahak closed 2 years ago

artursahak commented 3 years ago

Dear zhan-xu, I tried to run compute_volumetric_geodesic.py on my own dataset(much like the preprocessed folder you have), but here is my issue. Unable to allocate 76.2 GiB for an array with shape (1136630306, 3, 3)

Traceback (most recent call last):
  File "compute_volumetric_geodesic.py", line 173, in <module>
    one_process(dataset_folder, start_id, end_id)
  File "compute_volumetric_geodesic.py", line 130, in one_process
    pts_bone_visibility = calc_pts2bone_visible_mat(mesh_ori, origins, ends)
  File "compute_volumetric_geodesic.py", line 64, in calc_pts2bone_visible_mat
    locations, index_ray, index_tri = RayMeshIntersector.intersects_location(origins, ray_dir + 1e-15)
  File "C:\Anaconda3\envs\rigger\lib\site-packages\trimesh\ray\ray_triangle.py", line 107, in intersects_location
    **kwargs)
  File "C:\Anaconda3\envs\rigger\lib\site-packages\trimesh\ray\ray_triangle.py", line 66, in intersects_id
    triangles_normal=self.mesh.face_normals)
  File "C:\Anaconda3\envs\rigger\lib\site-packages\trimesh\ray\ray_triangle.py", line 244, in ray_triangle_id
    triangle_candidates = triangles[ray_candidates]
numpy.core._exceptions.MemoryError: Unable to allocate **76.2 GiB** for an array with shape (1136630306, 3, 3) and data type float64
zhan-xu commented 3 years ago

Hi, could you try to reduce the number of faces in the remeshed OBJ files? I modified a bit weeks ago in geometric_proc/compute_pretrain_attn.py . Take a look at Line 209-210

if subsampling:
     mesh = mesh.simplify_quadric_decimation(3000)

You can do similar things here. In general, this is because your remeshed OBJ file has too many faces. I will also modify here when I have more time.

artursahak commented 3 years ago

Yes, thank you. I manually updated models with meshlab to contain 3000 faces. In the meantime I have an invalid literal int for files in train folder after gen_dataset.py worked. File "C:\JavaTemp\RigNet\datasets\skeleton_dataset.py", line 107, in process name = int(v_filename.split('/')[-1].split('_')[0]) ValueError: invalid literal for int() with base 10: 'C:\\JavaTemp\\Dataset\\train\\1'

Would be great to hear your advice.

artursahak commented 3 years ago

In addition to that the rigs are "mixamo" rigs. Can it affect anyhow the result and spawn the error?

zhan-xu commented 3 years ago

Instead of ".split('/')", you may need ".split('\')", also check the value of "vfilename.split('/')[-1].split('')[0]". You can modify the code to adapt to your path. I didn't try mixamo data on rignet before. I assume you might need to tune the threshold to for it.

artursahak commented 2 years ago

Thank you very much, all the files are organized and trained, but there is another issue which I am working hard on(opened an issue :D).