Skip to content
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

FileNotFoundError for the YAML configs from imatch-toolbox #27

Open
v-pnk opened this issue Jan 25, 2025 · 5 comments
Open

FileNotFoundError for the YAML configs from imatch-toolbox #27

v-pnk opened this issue Jan 25, 2025 · 5 comments

Comments

@v-pnk
Copy link

v-pnk commented Jan 25, 2025

Hi! Thank you very much for this project!

I cannot call the get_matcher(...) on the methods from imatch-toolbox as the YAML config files are not installed with the matching package. The following script results in FileNotFoundError:

from matching import get_matcher
matcher = get_matcher("superglue", "cuda")
FileNotFoundError: [Errno 2] No such file or directory: '/home/<user>/micromamba/envs/meshext/lib/python3.10/site-packages/matching/third_party/imatch-toolbox/configs/superglue.yml'

When the same call is done inside a Python interactive shell from within the image-matching-models directory, the configs are found without any issues.

I already tried to solve this issue with imatch-toolbox some time ago but without success. Do you have any solution or advice?

@alexstoken
Copy link
Owner

Hi,

I'm out of town until Monday and can take a closer look then, but I suspect an "editable" -e install might avoid this while we work on a better fix.

Does the config directory itself (../../third_party/imatch-toolbox/configs) exist but is empty, or does that directory not exist?

@alexstoken
Copy link
Owner

So it seems the "As package" does not recursively capture and add all subdirectories (in particular, those that do not contain "package" aka python files) to site-packages at install.

The quick solution is the "From Source" install, but I'm looking into how to get these directories copied into the right place with the simple install as well.

@v-pnk
Copy link
Author

v-pnk commented Jan 29, 2025

Hi @alexstoken ,
Thanks for looking into the issue and sorry for the lack of communication from my side. I've been sick the last few days.

I can confirm that the "From Source" install copies the YAML configs for me.

I encounetered another similar issue with SuperGlue. The weights for SuperGlue models are stored directly in their repository. Therefore, the weights are cloned into image-matching-models/matching/third_party/imatch-toolbox/third_party/superglue/models/weights. However, they are not copied even with the "From Source" install.

@alexstoken
Copy link
Owner

Hope you are feeling better @v-pnk!

I've done similar testing and found the same issue for the model weights. It looks like the solution is to change to an "editable" install, with

pip install -e .

using the "From Source" method. I was able to get the script you sent (just the model loading) running after this. I also had to be in a numpy<2 env.

I'll look for a more permanent solution, probably involving downloading the model weights and configs to the proper place automatically, in the near future. This does not solve the "As package" install, which isn't compatible with -e.

Let me know if the editable install works!

@v-pnk
Copy link
Author

v-pnk commented Feb 1, 2025

Yes, the editable install works for me now. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants