facebookresearch / facebookresearch/pytorch3d

NaN when using MeshRasterizer

Open
#561 32 comments 0 reactions 1 assignee Claimed by @nikhilaravi View on GitHub
do-not-reap potential-bug
Dominant language
Python
Stars
10k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

# Description

I installed the latest pytorch3d 0.4 and tried to run the [fit_textured_mesh](https://github.com/facebookresearch/pytorch3d/blob/master/docs/tutorials/fit_textured_mesh.ipynb) tutorial under the **Mesh prediction via silhouette rendering** section. The loss becomes NaN after around 200 iterations (4 out of 5 times I can reproduce this issue).

I also tried pytorch3d 0.3 (built from source in December), and this issue never happened. Therefore, there might be some issues in the latest update for Mesh Rasterizer.

# Reproduce
Install pytorch 1.7.1
```
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
```

Install pytorch3d using wheels for linux [instruction](https://github.com/facebookresearch/pytorch3d/blob/master/INSTALL.md#3-install-wheels-for-linux)
```
pip install pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu102_pyt171/download.html
```
And then simply run the [fit_textured_mesh](https://github.com/facebookresearch/pytorch3d/blob/master/docs/tutorials/fit_textured_mesh.ipynb) tutorial, you should be able to reproduce results. I can obtain the nan 4 out 5 times I run.

Best,
Songyou

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.