-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Bug in clipping: index is out of bounds for dimension with size 0 #632
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
Comments
I was able to work around the bug by changing: pytorch3d/pytorch3d/renderer/mesh/clip.py Lines 642 to 643 in 24ee279
to if faces_clipped_to_unclipped_idx is None or\
(len(faces_clipped_to_unclipped_idx.shape) == 1 and faces_clipped_to_unclipped_idx.shape[0] == 0):
return pix_to_face_clipped, bary_coords_clipped However, I'm not sure if this fix is logically sound. |
I am having the same issue when using |
I had the same issue when I changed the |
@Algomorph the key differences I see compared to #631 are that you have changed the torus initialization options and the z clip value. Have you changed anything else? |
@nikhilaravi : beside the z-clip value, I only changed the dimensions of the torus, i.e.: meshes_torch3d = pytorch3d.utils.torus(1.0, 20.0, 32, 16, device=torch_device) |
Summary: There was a bug when `z_clip_value` is not None but there are no faces which are actually visible in the image due to culling. In `rasterize_meshes.py` a function `convert_clipped_rasterization_to_original_faces` is called to convert the clipped face indices etc back to the unclipped versions, but the case where there is no clipping was not handled correctly. Fixes Github Issue #632 Reviewed By: bottler Differential Revision: D29116150 fbshipit-source-id: fae82a0b4848c84b3ed7c7b04ef5c9848352cf5c
This issue should now be fixed by c75ca04. |
🐛 Bugs / Unexpected behaviors
Rasterizing a torus throws a bug in clipping if there are no clipped faces.
Instructions To Reproduce the Issue:
Run this code (very similar to #631, but with subtle differences):
Output
This raises the following error (disregard line numbers w/ respect to above code, early stacks are unimportant):
Version Info
Version info:
pytorch3d built from commit cc08c6b (from this this morning)
pytorch3d.version : '0.4.0'
torch.version: '1.7.0a0+57bffc3' ( == 1.7.1 release, built from source)
torch.version.cuda: '11.1'
Python: 3.8.5
OS: Ubuntu 20.04
The text was updated successfully, but these errors were encountered: