Skip to content

Crash when no matches are found #6

@tsattler

Description

@tsattler

Hi Qunjie,

Thanks for releasing the code!

I observed a test-time crash that happens when there are no matches found. The trace is

  File "../localize.py", line 385, in main
    matches, _, _, _ = matcher(img1_name, img2_name)
  File "../localize.py", line 314, in <lambda>
    matcher = lambda im1, im2: model.match_pairs(im1, im2)
  File "/local/datasets/aachen_day_night/temp/image-matching-toolbox/immatch/modules/patch2pix.py", line 86, in match_pairs
    io_thres=self.match_threshold)        
  File "/local/datasets/aachen_day_night/temp/image-matching-toolbox/immatch/modules/../../third_party/patch2pix/networks/patch2pix.py", line 296, in refine_matches
    regressor=self.regress_mid)
  File "/local/datasets/aachen_day_night/temp/image-matching-toolbox/immatch/modules/../../third_party/patch2pix/networks/patch2pix.py", line 215, in forward_fine_match
    psize, ptype, regressor)
  File "/local/datasets/aachen_day_night/temp/image-matching-toolbox/immatch/modules/../../third_party/patch2pix/networks/patch2pix.py", line 177, in forward_fine_match_mini_batch
    f1s = f1s.view(-1, N, psize, psize).permute(1, 0, 2, 3)
RuntimeError: cannot reshape tensor of 0 elements into shape [-1, 0, 16, 16] because the unspecified dimension size -1 can be any value and is ambiguous

Here, I am using your image matching toolbox to use patch2pix with superglue features to match two images.
Do you know what the best fix would be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions