Skip to content

"all input arrays must have the same shape" error while running loFTR pipeline #253

@paxabledev

Description

@paxabledev

Hello. Firstly congrats on this great work and thanks for sharing the code.

I have an indoor picture dataset consisting of 247 images each 9248x6936 pixels and taken with the same camera with the same settings.
I am trying to run a pipeline based on your Aachen_v1_1 pipeline using loFTR in order to increase the completeness of my point cloud (total number of 3d points). However, I keep getting the error given below in various different configurations while some configurations works smoothly.
For example:

  1. When I use "loftr" as dense matcher with "netvlad" as feature extractor, I get the same array error below when I use "indoor" weights but it works fine when I set the weights as "outdoor" although it is an indoor picture set.
  2. When I use "loftr_superpoint" as dense matcher with "superpoint_max_ as feature extractor, I get the same array error below if I set both "max_error" and "cell_size" to "1" or "2". However if I leave them both as "4" it works fine.
  3. When I use "loftr_superpoint" as dense matcher with "superpoint_max" as feature extractor, setting both "max_error" and "cell_size" to 4 but changing "Number of image pairs for SfM" and
    "Number of image pairs for loc" to 40 and 100, respectively gives me the same array error. Or just changing "Number of image pairs for SfM" from 20 to 40 causing the same error.

Since changes in different settings causing the same error, I cannot pinpoint what the actual reason can be. The only pattern I can see, whenever I change the settings in a way to increase the accuracy and completeness I start to get the same error.

The error is as follows:

[2022/12/01 23:18:34 hloc INFO] Importing matches into the database...
5%| | 250/4893 [00:00<00:02, 1578.48it/s]
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/paperspace/pixel-perfect-sfm/Hierarchical-Localization/hloc/pipelines/NEWbedroom02/pipeline.py", line 45, in
triangulation.main(
File "/home/paperspace/pixel-perfect-sfm/Hierarchical-Localization/hloc/triangulation.py", line 224, in main
import_matches(image_ids, database, pairs, matches,
File "/home/paperspace/pixel-perfect-sfm/Hierarchical-Localization/hloc/triangulation.py", line 90, in import_matches
matches, scores = get_matches(matches_path, name0, name1)
File "/home/paperspace/pixel-perfect-sfm/Hierarchical-Localization/hloc/utils/io.py", line 69, in get_matches
matches = np.stack([idx, matches[idx]], -1)
File "<array_function internals>", line 180, in stack
File "/home/paperspace/.local/lib/python3.8/site-packages/numpy/core/shape_base.py", line 426, in stack
raise ValueError('all input arrays must have the same shape')
ValueError: all input arrays must have the same shape

Your help is much appreciated.

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