facebookresearch / facebookresearch/pytorch3d

Unable to reproduce the results shown in the bundle_adjustment tutorial

Open
#1,071 7 comments 0 reactions 2 assignees Claimed by @davnov134 View on GitHub
bug do-not-reap documentation
Dominant language
Python
Stars
10k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

## 🐛 Bugs / Unexpected behaviors
Unable to reproduce the results shown in the plots of the [bundle adjustment](https://pytorch3d.org/tutorials/bundle_adjustment) tutorial, with the script unmodified.

## Instructions To Reproduce the Issue:
- The exact command(s) you ran:
Go to [bundle adjustment](https://pytorch3d.org/tutorials/bundle_adjustment) tutorial, click on [run in google colab](https://colab.research.google.com/github/facebookresearch/pytorch3d/blob/stable/docs/tutorials/bundle_adjustment.ipynb), run all cells.

- What you observed:
This imprecise result
![End result](https://user-images.githubusercontent.com/49728684/153594414-05e3a1fa-701b-45c8-8f8c-b796615b1e0c.png)
to compare with the "expected result" from the notebook introduction:
![expected end result](https://github.com/facebookresearch/pytorch3d/blob/main/docs/tutorials/data/bundle_adjustment_final.png?raw=1)

Just to be sure that this wasn't "bad luck" with the random seed, I commented the line `torch.manual_seed(42)` in the second code cell and ran the last cell >20 times. Each time I got a different result, and in only one case was the result matching perfectly the ground truth. In the other cases the final estimation was qualitatively as bad as in the screenshot above.
Maybe I also had bad luck with my trials, but anyways I wanted to let you know about this discrepancy between expected and actual behavior.

- Correction proposition
Using 4000 iterations instead of 2000 and increasing the learning rate from 0.1 to 0.4 does help to reach the correct solution, as with the initial parameters the poses had not finished to converge at 2000 iterations (by looking at the plots). The correct solution is however not consistently reached (e.g. running once with manual seed = 0 and then running a second time doesn't converge completely)

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.