Closed adricostas closed 1 year ago
Hi @adricostas , thank you for your interest in LightGlue-ONNX!
Likewise, I've been testing the models using ONNXRuntime Python. However, your code seems awfully similar to this issue: https://github.com/microsoft/onnxruntime/issues/5630, in which another user also gets a segfault in C++ despite the model working fine in Python.
I'm assuming you have session
as a member attribute of the DiskRunner
class, which unfortunately outlives the Ort::Env env
that was declared as a local variable in the constructor and subsequently destroyed at the end. The aforementioned issue suggests to make it a member of the class. Here is another issue mentioning the exact same thing: https://github.com/microsoft/onnxruntime/issues/5320. Here is a stackoverflow answer suggesting to declare env
as static
in order to extend its scope: https://stackoverflow.com/questions/62787710/how-can-i-fix-onnxruntime-session-run-problem
I could be totally wrong though, since I'm not well-versed in the C++ ONNXRuntime. If anyone more knowledgeable has a fix, please feel free to point it out.
I hope you find this helpful!
Hi @fabio-sim,
You were right! Now it is working. Thank you for helping me even when the issue was not finally related with lightglue itself.
@adricostas Hi! Would you be able to share your working c++ inference code and models? Thank you!
@adricostas Hi! Would you be able to share your working c++ inference code and models? Thank you!
@adricostas Hi! Would you be able to share your working c++ inference code and models? Thank you!
If you don't mind, you are welcome to use my repository https://github.com/OroChippw/LightGlue-OnnxRunner, currently supporting end-to-end model inference of SuperPoint and DISK ,Support for decoupling Superpoint/DISK and LightGLue will be provided in the future.If you have any suggestions or bugs, feedback is welcome.😊
@adricostas Hi! Would you be able to share your working c++ inference code and models? Thank you!
If you don't mind, you are welcome to use my repository https://github.com/OroChippw/LightGlue-OnnxRunner, currently supporting end-to-end model inference of SuperPoint and DISK ,Support for decoupling Superpoint/DISK and LightGLue .If you have any suggestions or bugs, feedback is welcome.😊
Hello,
Has anybody tried to use these ONNX models on C++? I'm trying to do so but I'm getting a Segmentation Fault during the inference. The model is loaded without any problem and the input shape seems to be ok (1,3,288,512). In python the inference is working. The code is the following: main.cpp
DiskRunner class (I have divided LighGlue class into two classes: one for the extractor and one for the matcher)
The auxiliar functions:
Any idea ?
Thanks