image-matching-toolbox icon indicating copy to clipboard operation
image-matching-toolbox copied to clipboard

How do I add my own methods to test?

Open zhubingerdai opened this issue 3 years ago • 5 comments

I copied the loftr code to add the required files, but when running my code failed: KeyError: 'block_type' Self. block_type = config['block_type'], which is the argument in my code

zhubingerdai avatar Jul 06 '22 13:07 zhubingerdai

The information your provided is not sufficient for me to understand what the situation is.

GrumpyZhou avatar Jul 06 '22 18:07 GrumpyZhou

For example, I replaced "attention" in "loftr" with "quardtree attention". Then I put the code in your code like "loftr".
model = immatch.dictclass_name loftr.py line23 self.model = LoFTR_(config=conf)
KeyError: 'block_type' https://github.com/Tangshitao/QuadtreeAttention

zhubingerdai avatar Jul 07 '22 03:07 zhubingerdai

Might be related to missing config of 'block_type' in the config file. Can you check whether this block_type is used in your model and has been configured in the conf? Btw, next time can you post the full error? It is out of track where this key error happens.

GrumpyZhou avatar Jul 07 '22 05:07 GrumpyZhou

Ok, thank you. The problem has been solved. It is indeed a configuration problem. But the test results are all 0. What do you think might be the problem?

zhubingerdai avatar Jul 07 '22 07:07 zhubingerdai

Make sure you load the pretrained weights properly. You can also debug by just by printing the number of matches , something like that ... If your problem is solved then please close the issue.

GrumpyZhou avatar Jul 07 '22 17:07 GrumpyZhou