- edited description
Very slow factor graph optimization
Using the Matlab wrapper I created a factor graph with 13 cameras and 318 world points, with a total 6398 projections which I added to the graph using GenericProjectionFactorCal3_S2. Also, 12 of the cameras are fixed using NonlinearEqualityPose3.
When I solve it using LevenbergMarquardtOptimizer with default parameters I get the right results (validated by comparison to a pure Matlab implementation of BA) but excruciatingly slowly: 4.5s instead of 0.23s in pure Matlab.
Is this reasonable? Is GTSAM known to slow way down on such graphs or am I doing something wrong? I tried to play around with the LM parameters but to little avail.
Many thanks in advance,
Felix
P.S. Actually this scenario is about a stereo camera in 13 different poses. Since the relative pose between the left & right cameras is known, I use the body_P_sensor argument of GenericProjectionFactorCal3_S2 to encode observations in the right camera.
Comments (8)
-
reporter -
I also encountered this problem!Very Slow!
-
-
assigned issue to
-
assigned issue to
-
Hi, sorry it takes so long for us to get back to you. You might have already figured out this problem, however, if not, I would suggest you try the newest version to see if you still have the same issue. If you do, please let us know, we will start from here.
-
- changed status to wontfix
Always trying to make GTSAM faster
-
@m_matrix , I know this was a long time ago, but do you still have a file with the data ? We can maybe use it as a benchmark which I want to set up, as part of a CI server.
-
Hi Frank: Just in case it might be useful, here’s a test for iSAM2 & LevMarq. with 20 keyframes with stereo observations:
- [test code](https://bitbucket.org/jlblancoc/gtsam/src/new-stereo-smart-factor-test/examples/ISAM2_SmartFactorStereo.cpp)
- [data](https://bitbucket.org/jlblancoc/gtsam/src/new-stereo-smart-factor-test/examples/Data/ISAM2_SmartFactorStereo.txt)
- [ground truth](https://bitbucket.org/jlblancoc/gtsam/src/new-stereo-smart-factor-test/examples/Data/ISAM2_SmartFactorStereo_GT_path.txt)
Now that I’m revisiting it, I realized there is no automated load and check vs. the ground truth, though… (sigh)
BTW: the iSAM2 version doesn’t work due to the smart factors bug (still on the queue…).
-
Jose. We will announce this soon, but we are moving to Github. Do you want to do a PR there?
Regarding the smartfactor bug, did you see my recent comment? I’d propose you open a new issue on github so we can close the other one.
- Log in to comment