-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove check in database_cache.cc that breaks backwards compatibility with image_list_file_path #3478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove check in database_cache.cc that breaks backwards compatibility with image_list_file_path #3478
Conversation
|
Hey. Thanks for reporting! Could you share the database and the command? I cannot reproduce this error with my legacy database, which seems to work fine for me. Are you sure that your image is not missing in the image_list_path? |
|
I see the issue now. It happens when you specify image_list_path and has only partial set of images in the image_names. Rather than removing the check, I would move this line up before the check, which simply becomes: Indeed, this seems to be a big issue in terms of backwards compatibility and needs attention. |
|
So, the else block would look like this? I changed the code as suggested. I re-ran the code that failed here, and the issue seems resolved. |
ahojnnes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM.
|
If at all possible, it can be good to have a unit test for this bug. |
I added a unit test. |
|
Thank you for the fix. |
… with image_list_file_path (#3478) If we try to load a pre-3.12 (pre sensor rig support) db, and we also pass `--image_list_path`, the db loading will fail mainly due to the lines I am removing in this PR. Not sure why we have those in there. The error that pops up without this change: ``` I20250711 11:43:48.726486 140208169588800 incremental_pipeline.cc:253] Loading database I20250711 11:43:48.728317 140208169588800 database_cache.cc:66] Loading rigs... I20250711 11:43:48.728328 140208169588800 database_cache.cc:76] 0 in 0.000s I20250711 11:43:48.728333 140208169588800 database_cache.cc:84] Loading cameras... I20250711 11:43:48.728343 140208169588800 database_cache.cc:102] 1 in 0.000s I20250711 11:43:48.728346 140208169588800 database_cache.cc:110] Loading frames... I20250711 11:43:48.728351 140208169588800 database_cache.cc:127] 0 in 0.000s I20250711 11:43:48.728355 140208169588800 database_cache.cc:135] Loading matches... I20250711 11:43:48.756288 140208169588800 database_cache.cc:140] 9644 in 0.028s I20250711 11:43:48.756310 140208169588800 database_cache.cc:156] Loading images... terminate called after throwing an instance of 'std::out_of_range' what(): unordered_map::at *** Aborted at 1752227028 (unix time) try "date -d @1752227028" if you are using GNU date *** PC: @ 0x7f84c62ef00b signal ``` The actual error is coming from here: ``` const frame_t frame_id1 = image_to_frame_id.at(image_id1); const frame_t frame_id2 = image_to_frame_id.at(image_id2); ``` line 205, 206 --------- Co-authored-by: Shaohui Liu <[email protected]> Co-authored-by: Johannes Schönberger <[email protected]> Co-authored-by: Johannes Schönberger <[email protected]>
If we try to load a pre-3.12 (pre sensor rig support) db, and we also pass
--image_list_path, the db loading will fail mainly due to the lines I am removing in this PR. Not sure why we have those in there.The error that pops up without this change:
The actual error is coming from here:
line 205, 206