Skip to content

GLOMAP mapper crashes during retriangulation with "Check failed:..." errors. #219

@jettd

Description

@jettd

Summary

I’m attempting to run GLOMAP as a drop-in replacement for COLMAP’s mapper.
However, GLOMAP consistently crashes during retriangulation when run on my dataset—even with the simplest invocation (--database_path, --image_path, --output_path only).

Error:

Check failed: existing_frame.DataIds() == frame.DataIds()
terminate called after throwing an instance of 'std::invalid_argument'
what(): [reconstruction.cc:166] Check failed: existing_frame.DataIds() == frame.DataIds()

Or, in another run:

Check failed: existing_rig.RefSensorId() == rig.RefSensorId()
what(): [reconstruction.cc:153]

This happens with any of the following:

  • Using GLOMAP directly from the command line
  • Calling GLOMAP from another tool (Nerfstudio)
  • Running on a dataset that COLMAP itself handles without issues

Environment

Base OS: nerfstudio:latest Docker imagev(Ubuntu 22.04)
CMake used for GLOMAP build: 3.28.0
COLMAP: whatever version comes inside Nerfstudio’s Docker image
GLOMAP build steps:
[download cmake 3.28.0 release from git since the docker has 3.25 which is not compatible]

git clone https://github.com/colmap/glomap
mkdir build && cd build
cmake .. -GNinja 
ninja
sudo ninja install

Using cmake 3.28.0, there are no errors during the build.

Minimal Reproduction

I prepared a minimal reproduction dataset, including:

  • Input images (images/)
  • The COLMAP-generated database.db (from feature_extractor + exhaustive_matcher)

Zipped example

Commands to Reproduce

  1. colmap feature_extractor --image_path /workspace/col_vs_glo_comparison/minimal_reproduction/images/ --database_path minimal_reproduction/colmap/database.db
  2. colmap exhaustive_matcher --database_path minimal_reproduction/colmap/database.db --SiftMatching.use_gpu 1
  3. glomap mapper --database_path minimal_reproduction/colmap/database.db --image_path minimal_reproduction/images/ --output_path minimal_reproduction/colmap/sparse/

Console output

user@64af46311bb4:/workspace/col_vs_glo_comparison$ glomap mapper --database_path minimal_reproduction/colmap/database.db --image_path minimal_reproduction/images/ --outputmap/sparse/
 Loading Images 20 / 20
 Loading Image Pair 107 / 107
I1113 19:21:09.903759 14761 colmap_converter.cc:424] Pairs read done. 13 / 107 are invalid
I1113 19:21:09.905555 14761 global_mapper.cc:84] Loaded database
-------------------------------------
Running preprocessing ...
-------------------------------------
I1113 19:21:09.906014 14761 view_graph_manipulation.cc:255] Decompose relative pose for 0 pairs
I1113 19:21:09.907400 14761 view_graph_manipulation.cc:309] Decompose relative pose done. 0 pairs are pure rotation
I1113 19:21:09.907776 14761 timer.cc:86] Elapsed time: 0.00221 [seconds]
-------------------------------------
Running view graph calibration ...
-------------------------------------
I1113 19:21:09.907850 14761 view_graph_calibration.cc:16] Start ViewGraphCalibrator
I1113 19:21:09.924733 14761 view_graph_calibration.cc:147] 2 cameras are rejected in view graph calibration
I1113 19:21:09.925156 14761 view_graph_calibration.cc:181] invalid / total number of two view geometry: 3 / 89
-------------------------------------
Running relative pose estimation ...
-------------------------------------
I1113 19:21:09.926764 14761 image_undistorter.cc:20] Undistorting images..
I1113 19:21:09.930692 14761 image_undistorter.cc:44] Image undistortion done
I1113 19:21:09.932044 14761 relpose_estimation.cc:26] Estimating relative pose for 91 pairs
 Estimating relative pose: 100%
I1113 19:21:15.687136 14761 relpose_estimation.cc:122] Estimating relative pose done
I1113 19:21:15.689946 14761 relpose_filter.cc:46] Filtered 14 relative poses with inlier number < 30
I1113 19:21:15.689968 14761 relpose_filter.cc:63] Filtered 0 relative poses with inlier ratio < 0.25
I1113 19:21:15.690016 14761 timer.cc:86] Elapsed time: 5.76433 [seconds]
-------------------------------------
Running rotation averaging ...
-------------------------------------
I1113 19:21:15.690048 14761 rotation_averager.cc:44] Total image pairs: 0, gravity image pairs: 0
I1113 19:21:15.694929 14761 relpose_filter.cc:31] Filtered 27 relative rotation with angle > 10 degrees
I1113 19:21:15.694984 14761 rotation_averager.cc:44] Total image pairs: 0, gravity image pairs: 0
I1113 19:21:15.695243 14761 relpose_filter.cc:31] Filtered 0 relative rotation with angle > 10 degrees
I1113 19:21:15.695269 14761 global_mapper.cc:113] 40 / 20 images are within the connected component.
I1113 19:21:15.695281 14761 timer.cc:86] Elapsed time: 0.00525 [seconds]
-------------------------------------
Running track establishment ...
-------------------------------------
 Initializing pairs 107 / 107
 Establishing pairs 107 / 107
 Establishing tracks 37946 / 37946
I1113 19:21:15.749006 14761 track_establishment.cc:149] Discarded 6 tracks due to inconsistency
I1113 19:21:15.768522 14761 global_mapper.cc:133] Before filtering: 37946, after filtering: 19837
I1113 19:21:15.768563 14761 timer.cc:86] Elapsed time: 0.07328 [seconds]
-------------------------------------
Running global positioning ...
-------------------------------------
I1113 19:21:15.773082 14761 image_undistorter.cc:20] Undistorting images..
I1113 19:21:15.773159 14761 image_undistorter.cc:44] Image undistortion done
E1113 19:21:15.773742 14761 global_positioning.cc:35] Number of camera rigs = 20
I1113 19:21:15.776067 14761 global_positioning.cc:52] Setting up the global positioner problem
W1113 19:21:15.848694 14761 global_positioning.cc:512] Requested to use GPU for bundle adjustment, but Ceres was compiled without CUDA support. Falling back to CPU-based de
W1113 19:21:15.848770 14761 global_positioning.cc:529] Requested to use GPU for bundle adjustment, but Ceres was compiled without cuDSS support. Falling back to CPU-based s
I1113 19:21:15.848773 14761 global_positioning.cc:79] Solving the global positioner problem
I1113 19:21:25.149843 14761 global_positioning.cc:88] Ceres Solver Report: Iterations: 66, Initial cost: 5.714880e+05, Final cost: 1.655039e+01, Termination: CONVERGENCE
I1113 19:21:25.153563 14761 track_filter.cc:87] Filtered 4703 / 19837 tracks by angle error
I1113 19:21:25.155431 14761 track_filter.cc:124] Filtered 783 / 19837 tracks by too small triangulation angle
I1113 19:21:25.157932 14761 track_filter.cc:49] Filtered 49 / 19837 tracks by reprojection error
I1113 19:21:25.158118 14761 timer.cc:86] Elapsed time: 9.38567 [seconds]
-------------------------------------
Running bundle adjustment ...
-------------------------------------
I1113 19:21:25.205345 14761 global_mapper.cc:196] Bundle adjustment start
W1113 19:21:25.235986 14761 bundle_adjustment.cc:55] Requested to use GPU for bundle adjustment, but Ceres was compiled without CUDA support. Falling back to CPU-based dens
W1113 19:21:25.236054 14761 bundle_adjustment.cc:72] Requested to use GPU for bundle adjustment, but Ceres was compiled without cuDSS support. Falling back to CPU-based spa
I1113 19:21:26.372144 14761 bundle_adjustment.cc:103] Ceres Solver Report: Iterations: 30, Initial cost: 3.062842e+06, Final cost: 1.454823e+06, Termination: CONVERGENCE
I1113 19:21:26.372190 14761 global_mapper.cc:212] Global bundle adjustment iteration 1 / 3, stage 1 finished (position only)
I1113 19:21:26.372239 14761 timer.cc:86] Elapsed time: 1.16688 [seconds]
I1113 19:21:31.860244 14761 bundle_adjustment.cc:103] Ceres Solver Report: Iterations: 118, Initial cost: 1.454823e+06, Final cost: 7.179724e+04, Termination: CONVERGENCE
I1113 19:21:31.860298 14761 global_mapper.cc:224] Global bundle adjustment iteration 1 / 3, stage 2 finished
I1113 19:21:31.860302 14761 timer.cc:86] Elapsed time: 6.65495 [seconds]
I1113 19:21:31.861344 14761 image_undistorter.cc:20] Undistorting images..
I1113 19:21:31.863484 14761 image_undistorter.cc:44] Image undistortion done
I1113 19:21:31.863716 14761 global_mapper.cc:238] Filtering tracks by reprojection ...
I1113 19:21:31.866765 14761 track_filter.cc:49] Filtered 1419 / 19837 tracks by reprojection error
I1113 19:21:32.554118 14761 bundle_adjustment.cc:103] Ceres Solver Report: Iterations: 14, Initial cost: 6.590724e+04, Final cost: 6.584952e+04, Termination: CONVERGENCE
I1113 19:21:32.554175 14761 global_mapper.cc:212] Global bundle adjustment iteration 2 / 3, stage 1 finished (position only)
I1113 19:21:32.554179 14761 timer.cc:86] Elapsed time: 7.34882 [seconds]
I1113 19:21:33.244115 14761 bundle_adjustment.cc:103] Ceres Solver Report: Iterations: 12, Initial cost: 6.584952e+04, Final cost: 6.564459e+04, Termination: CONVERGENCE
I1113 19:21:33.244164 14761 global_mapper.cc:224] Global bundle adjustment iteration 2 / 3, stage 2 finished
I1113 19:21:33.244168 14761 timer.cc:86] Elapsed time: 8.03881 [seconds]
I1113 19:21:33.245056 14761 image_undistorter.cc:20] Undistorting images..
I1113 19:21:33.247424 14761 image_undistorter.cc:44] Image undistortion done
I1113 19:21:33.247658 14761 global_mapper.cc:238] Filtering tracks by reprojection ...
I1113 19:21:33.250438 14761 track_filter.cc:49] Filtered 9 / 19837 tracks by reprojection error
I1113 19:21:33.252727 14761 track_filter.cc:49] Filtered 49 / 19837 tracks by reprojection error
I1113 19:21:33.269822 14761 image_undistorter.cc:20] Undistorting images..
I1113 19:21:33.271999 14761 image_undistorter.cc:44] Image undistortion done
I1113 19:21:33.272576 14761 global_mapper.cc:264] Filtering tracks by reprojection ...
I1113 19:21:33.275648 14761 track_filter.cc:49] Filtered 0 / 19837 tracks by reprojection error
I1113 19:21:33.277594 14761 track_filter.cc:124] Filtered 4242 / 19837 tracks by too small triangulation angle
I1113 19:21:33.277626 14761 timer.cc:86] Elapsed time: 8.07227 [seconds]
-------------------------------------
Running retriangulation ...
-------------------------------------
I1113 19:21:33.278896 14761 database_cache.cc:67] Loading rigs...
I1113 19:21:33.279160 14761 database_cache.cc:77]  0 in 0.000s
I1113 19:21:33.279201 14761 database_cache.cc:85] Loading cameras...
I1113 19:21:33.279651 14761 database_cache.cc:103]  20 in 0.000s
I1113 19:21:33.279675 14761 database_cache.cc:111] Loading frames...
I1113 19:21:33.279865 14761 database_cache.cc:126]  0 in 0.000s
I1113 19:21:33.279886 14761 database_cache.cc:134] Loading matches...
I1113 19:21:33.280405 14761 database_cache.cc:139]  94 in 0.001s
I1113 19:21:33.280426 14761 database_cache.cc:155] Loading images...
I1113 19:21:33.383469 14761 database_cache.cc:239]  20 in 0.103s (connected 20)
I1113 19:21:33.383517 14761 database_cache.cc:250] Building correspondence graph...
I1113 19:21:33.397121 14761 database_cache.cc:277]  in 0.014s (ignored 0)
E1113 19:21:33.402380 14761 reconstruction.cc:153] Check failed: existing_rig.RefSensorId() == rig.RefSensorId()
terminate called after throwing an instance of 'std::invalid_argument'
  what():  [reconstruction.cc:153] Check failed: existing_rig.RefSensorId() == rig.RefSensorId()
*** Aborted at 1763061693 (unix time) try "date -d @1763061693" if you are using GNU date ***
PC: @                0x0 (unknown)
*** SIGABRT (@0x3e8000039a9) received by PID 14761 (TID 0x7c6ac6431400) from PID 14761; stack trace: ***
    @     0x7c6ac8caf046 (unknown)
    @     0x7c6ac860d520 (unknown)
    @     0x7c6ac86619fc pthread_kill
    @     0x7c6ac860d476 raise
    @     0x7c6ac85f37f3 abort
    @     0x7c6ac899cb9e (unknown)
    @     0x7c6ac89a8277 std::terminate()
    @     0x7c6ac89a84d8 __cxa_throw
    @     0x58bf3d34d69e colmap::LogMessageFatalThrow<>::~LogMessageFatalThrow()
    @     0x58bf3d619a66 colmap::Reconstruction::Load()
    @     0x58bf3d468365 colmap::IncrementalMapper::BeginReconstruction()
    @     0x58bf3d356724 glomap::RetriangulateTracks()
    @     0x58bf3d335ab0 glomap::GlobalMapper::Solve()
    @     0x58bf3d32c09d glomap::RunMapper()
    @     0x58bf3d3266f8 main
    @     0x7c6ac85f4d90 (unknown)
    @     0x7c6ac85f4e40 __libc_start_main
    @     0x58bf3d328035 _start
Aborted (core dumped)

If any other information is needed, I can provide it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions