Comments (10)
ok it might be something else in the sample_points_from_meshes
function which is causing the error.
Can you try adding the same print statements at the beginning of the function? Can you share the jupyter notebook of your modified code or provide a complete loop that we can run to debug further?
from pytorch3d.
Good point, the deform_verts
tensor containing the deformation of the vertices indeed contains NaNs before crashing. So the issue does not come from the point sampling or the mesh functions. The maximum of the deformation vector norms grows slowly, stays below 0.3 and suddenly 2 deformation vectors turn to NaNs.
The points don't go to infinity but I'm guessing they get pushed to a weird configuration where perhaps an edge or a face is singular. I tried playing around with the weights of the laplacian loss, edge loss and normal loss but setting the weights to zero also doesn't impact this.
One possible explanation could be the blur parameter of the renderer. If I leave it at the default it gives this
The loss is low for vertices in the yellow regions, and since there are some small yellow cavities like in the eye of the dolphin, it could be that singularities arise if points get pushed to the same small region.
If I set the blur parameter of the renderer to lower, the cavities disappear but the loss function gets discontinuous so optimization gets extremely slow. I'll try to see if I can find a decent balance for that parameter.
from pytorch3d.
This is unrelated to the other issue. The device-side assert
is triggered for example if there are invalid indices being used to index into a tensor.
Before sample_src = sample_points_from_meshes(new_src_mesh, 5000)
can you add a print statement to check new_src_mesh.valid
and new_src_mesh.mesh_to_faces_packed_first_idx()
?
from pytorch3d.
Thanks for your quick answer.
The output remains the same throughout optimization, even just before the sampling that fails :
tensor([True]) # new_src_mesh.valid
tensor([0]) # new_src_mesh.mesh_to_faces_packed_first_idx()
from pytorch3d.
Something strange, if I print new_src_mesh.valid
just before the sampling it works fine but if I add the prints in the source code just before the line that triggers the device-side assert it fails :
~/coding/python/pytorch3d/env/lib/python3.7/site-packages/pytorch3d/ops/sample_points_from_meshes.py in sample_points_from_meshes(meshes, num_samples, return_normals)
64 num_samples, replacement=True
65 ) # (N, num_samples)
---> 66 print(mesh_to_face.cpu())
67 print(meshes.valid.cpu())
68 sample_face_idxs += mesh_to_face[meshes.valid].view(num_valid_meshes, 1)
RuntimeError: CUDA error: device-side assert triggered
from pytorch3d.
@vilhub were you able to resolve this issue? Alternatively as suggested in #82 can you save meshes.verts_padded()
and meshes.faces_padded()
to a file before the call to sample_points_from_meshes
and share them here? (you can save these values at each iteration but we only need the values from the iteration when the error occurs)
We can then try to load and run the inputs that to reproduce the error and debug from there.
from pytorch3d.
Hi, sorry for the late answer, I haven't resolved the issue since I haven't had time yet. Tomorrow I will investigate and meanwhile I uploaded the notebook here https://github.com/vilhub/pytorch3d/blob/master/docs/tutorials/build_mesh_from_angles.ipynb .
Thanks a lot for your help!
from pytorch3d.
Can you check whether your predictions are nans? This might be a cause of error. Note that if you set the weights of some losses to high this can happen.
from pytorch3d.
@vilhub can I close this issue?
from pytorch3d.
Closing this issue. If you are still experiencing issues feel free to reopen it.
from pytorch3d.
Related Issues (20)
- Can we use timeseries of Pointclouds to classify HOT 1
- Render Densepose example: IndexError: tensors used as indices must be long, byte or bool tensors
- Win11: The detected CUDA version (12.0) mismatches the version that was used to compile PyTorch (11.7). HOT 1
- RuntimeError: Not compiled with GPU support when running knn HOT 3
- IndexError occurs when passing the `Meshes` with the last one being an empty mesh into `SubdivideMeshes`
- How can I align rendered image to be in the center? HOT 1
- windows11 install problem HOT 3
- How to continuous control of the camera based on the R_init and T_init. HOT 1
- ImportError: DLL load failed while importing _C: The specified program could not be found. HOT 5
- when i use pytorch3d to visual a voxel error. HOT 1
- Python 3.12
- std::optional pulsar build ERROR HOT 1
- Any plan to support `torch.func`? HOT 10
- Farthest Point Sampling to a predefined radius HOT 2
- can't install in colab HOT 2
- Get intersections between meshes / lines with meshes HOT 1
- Faces list creation does not work on MacOS HOT 2
- Bad rendering results on A100 GPU, but right in V100 or Tesla T4 GPU.
- RuntimeError: The backward pass for this operation requires the 'self' tensor to be strided, but a sparse tensor was given instead. HOT 1
- box3d_overlap may cause “RuntimeError: CUDA error: an illegal memory access was encountered” in some cases HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch3d.