OroChippw / LightGlue-OnnxRunner

LightGlue-OnnxRunner is a repository hosts the C++ inference code of LightGlue in ONNX format,supporting end-to-end/decouple model inference of SuperPoint/DISK + LightGlue
MIT License
150 stars 22 forks source link

ONNXRuntime environment created failed #17

Open easonzhong123 opened 1 year ago

easonzhong123 commented 1 year ago

Thanks for your works sharing! I am a newcomers of deep learning deployment and i come across this problem shown below: cuda_problem

easonzhong123 commented 1 year ago

I think it might be result from the cudnn missing or something else?

OroChippw commented 1 year ago

I think it might be result from the cudnn missing or something else?

You should put several dll files named onnxruntime.dll onnxruntime_providers_shared.dll onnxruntime_providers_cuda.dll in the same directory as the generated exe executable file.

easonzhong123 commented 1 year ago

1 I think l have placed all dll files in the exe file.

OroChippw commented 1 year ago

It can be seen that your cmd error is as shown in the picture below. If you still can't run the dll after you have placed it, is there any error message? image

easonzhong123 commented 1 year ago

提示onnxruntime 环境创建失败,崩在这里。 2023-09-18 13_07_41-LightGlue-OnnxRunner (正在调试) - Microsoft Visual Studio

然后我通过一行一行断点,发现是在第39行崩的 2023-09-18 13_13_55-LightGlue-OnnxRunner (正在调试) - Microsoft Visual Studio

OroChippw commented 1 year ago

使用end-to-end模型会出现这样的问题吗(尝试一下),从图中看使用的是解耦后的两个模型,我可以看看你的main.cpp部分的配置信息尝试进行复现报错吗?

easonzhong123 commented 1 year ago

endtoend我倒是还没试过,稍等我尝试一下 2023-09-18 13_52_07-LightGlue-OnnxRunner (正在调试) - Microsoft Visual Studio 您方便把您转的模型发我一下么,superpoint 匹配和lightglue匹配的。

easonzhong123 commented 1 year ago

我发现github这边不支持发onnx文件,您方便的话可以给我邮箱我把我转的middletoend的onnx模型发您。

OroChippw commented 1 year ago

endtoend我倒是还没试过,稍等我尝试一下 2023-09-18 13_52_07-LightGlue-OnnxRunner (正在调试) - Microsoft Visual Studio 您方便把您转的模型发我一下么,superpoint 匹配和lightglue匹配的。

使用的所有模型文件,在该网盘链接下可获取:链接:https://pan.baidu.com/s/1LSMn7YiJlJVvN0o1H7BDew?pwd=pgnf 提取码:pgnf --来自百度网盘超级会员V5的分享

easonzhong123 commented 1 year ago

我根据堆栈帧往上翻看见崩溃点在这里, 2023-09-18 14_39_10-LightGlue-OnnxRunner (正在调试) - Microsoft Visual Studio 尝试了endtoend报错了同样的问题

easonzhong123 commented 1 year ago

我用cpu测试了一下效果是没啥问题的,而且我发现我这边的耗时比您测出的效果要好很多不知为何。 2023-09-18 15_54_38-D__deep_learning_deploy_LightGlue-OnnxRunner_build_Release_main exe

OroChippw commented 1 year ago

我用cpu测试了一下效果是没啥问题的,而且我发现我这边的耗时比您测出的效果要好很多不知为何。 2023-09-18 15_54_38-D__deep_learning_deploy_LightGlue-OnnxRunner_build_Release_main exe

与图像所提取的特征点数量有关,我的测试图像中约有2300多个特征点,当然也存在设备之间的差异性。目前是CPU能进行运行,GPU无法运行吗?刚刚尝试复现你所提的报错,没有复现出来

easonzhong123 commented 1 year ago

是的CPU可行GPU不太行,我看报错应该是InitOrtEnv的AppendExecutionProvider_CUDA失败直接throw了,接着InputNodeShapes这些都未初始化然后崩了。猜测可能和cuda配置有关

OroChippw commented 1 year ago

是的CPU可行GPU不太行,我看报错应该是InitOrtEnv的AppendExecutionProvider_CUDA失败直接throw了,接着InputNodeShapes这些都未初始化然后崩了。猜测可能和cuda配置有关

有一个猜想但不知道对不对,使用的onnxruntime-gpu是要和本机的CUDA相对应的,你可以看看你本机的CUDA版本,再获取对应支持的onnxruntime-gpu版本进行尝试

easonzhong123 commented 1 year ago

老哥我搞定了,要加cudnn然后还有个很莫名的操作。多谢分享QAQ

easonzhong123 commented 1 year ago

我本机有和你对齐是CUDA 11.7的版本,onnxruntime-gpu是1.15.0

OroChippw commented 1 year ago

老哥我搞定了,要加cudnn然后还有个很莫名的操作。多谢分享QAQ

解决了就好,预祝你的深度学习模型部署之路一路顺风😊😊😊

easonzhong123 commented 1 year ago

非常感谢您的帮助!

easonzhong123 commented 1 year ago

您好我还有一个问题想叨扰一下,我用https://github.com/fabio-sim/LightGlue-ONNX这个脚本转的end2end onnx文件总是会报输入图像的尺寸失败问题。想问问您这边是用的哪套参数进行的转换 非常感谢 2023-09-26 09_52_03-Window

OroChippw commented 1 year ago

您好我还有一个问题想叨扰一下,我用https://github.com/fabio-sim/LightGlue-ONNX这个脚本转的end2end onnx文件总是会报输入图像的尺寸失败问题。想问问您这边是用的哪套参数进行的转换 非常感谢 2023-09-26 09_52_03-Window

我并没有去尝试转化onnx模型,因为作者已经在release里面提供了不同的动态输入模型以及各种规格的静态尺寸输入模型,我使用的模型都是该仓库作者直接发布出来的

easonzhong123 commented 1 year ago

了解,我发现我漏掉了dynamic 这个选项导致的这个问题。再次感谢您的回复,话说您有考虑部署一下superglue么。我在使用中发现superglue有时候效果要比lightglue更鲁棒

OroChippw commented 1 year ago

了解,我发现我漏掉了dynamic 这个选项导致的这个问题。再次感谢您的回复,话说您有考虑部署一下superglue么。我在使用中发现superglue有时候效果要比lightglue更鲁棒

由于正在推进其他项目,所以现阶段暂时没有部署superglue的计划,选用lightglue就是因为相比起superglue,其有鲁棒性和速度性能上有更好的平衡

Berlin000000 commented 1 year ago

Thanks for your works sharing! I am a newcomers of deep learning deployment and i come across this problem shown below: cuda_problem 你好,我在 INITIAL ONNXRUNTIME ENV START报错 [ERROR] ONNXRuntime environment created failed : Load model from xxxx(一大串乱码),我看您也有类似的问题,请问您知道这里该怎么解决吗【定位到detail::ThrowStatus(st)函数报错】。

Berlin000000 commented 1 year ago

Thanks for your works sharing! I am a newcomers of deep learning deployment and i come across this problem shown below: cuda_problem 你好,我在 INITIAL ONNXRUNTIME ENV START报错 [ERROR] ONNXRuntime environment created failed : Load model from xxxx(一大串乱码),我看您也有类似的问题,请问您知道这里该怎么解决吗【定位到detail::ThrowStatus(st)函数报错】。

image 我的报错长这样 @OroChippw 麻烦大佬有时间帮忙看看

Berlin000000 commented 1 year ago

image 最终报错函数是ThrowOnError,this为空指针

chenscottus commented 11 months ago

image 最终报错函数是ThrowOnError,this为空指针

it's located here: C:\Windows\System32\onnxruntime.dll

you're running into these rules: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order As the DLL is loaded on app launch, the options set in Visual Studio have no effect, it is the OS rules that apply. One simple way to fix this would be to copy the onnxruntime.dll you installed (since you mentioned gpu, you should copy all onnxruntime*.dll files) into the same folder as your .exe. Then the OS will find this one first.

https://github.com/mspaintmsi/superUser superUser is a simple and lightweight utility to start any process with TrustedInstaller privileges.

copy D:\Tools\onnxruntime-win-x64-1.16.1\lib\onnxruntime.dll C:\Windows\System32\onnxruntime.dll

zhongyisang commented 11 months ago

Thanks for your works sharing! I am a newcomers of deep learning deployment and i come across this problem shown below: cuda_problem 你好,我在 INITIAL ONNXRUNTIME ENV START报错 [ERROR] ONNXRuntime environment created failed : Load model from xxxx(一大串乱码),我看您也有类似的问题,请问您知道这里该怎么解决吗【定位到detail::ThrowStatus(st)函数报错】。

三个可能 cuda版本 cudnn没配,还有就是zlibwapi.dll没有

xiaolong-217 commented 9 months ago

你好 我遇到了这个问题 [INFO] => inference start [INFO] => inference end1 < - -------- INFERENCEIMAGE START -------- -> [INFO] => PreProcess srcImage [INFO] Image info : width : 512 height : 5[ERROR] ONNXRuntime environment created failed : Load model from failed:Load model failed. File doesn't exist 12 [INFO] ExtractorType Superpoint turn RGB to Grayscale [INFO] Scale from 1 to 1 [INFO] => PreProcess destImage [INFO] Image info : width : 512 height : 512 我能够确认onnx的路径都是正确的 并且onnx文件没有损坏 我使用的是cpu进行推理

cjl-2000 commented 3 months ago

图像最终报错函数是ThrowOnError,this为空指针

您好,请问这个问题解决了吗,我也遇到了这个问题

cjl-2000 commented 3 months ago

感谢您的作品分享!我是深度学习部署的新手,我遇到了如下所示的问题: cuda_problem 你好,我在 INITIAL ONNXRUNTIME ENV START报错 [ERROR] ONNXRuntime environment created failed : Load model from xxxx(一大串乱码),我看您也有类似的问题,请问您知道这里该怎么解决吗【定位到细节::ThrowStatus(st)函数报错】。

三个可能 cuda版本 cudnn没配,还有就是zlibwapi.dll没有

您好,我按照您的意见将三个方面都检查了,还是会出现乱码

zhongyisang commented 3 months ago

感谢您的作品分享!我是深度学习部署的新手,我遇到了如下所示的问题: cuda_problem 你好,我在 INITIAL ONNXRUNTIME ENV START报错 [ERROR] ONNXRuntime environment created failed : Load model from xxxx(一大串乱码),我看您也有类似的问题,请问您知道这里该怎么解决吗【定位到细节::ThrowStatus(st)函数报错】。

三个可能 cuda版本 cudnn没配,还有就是zlibwapi.dll没有

您好,我按照您的意见将三个方面都检查了,还是会出现乱码

你有把onnxruntime的dll都拷贝到可执行文件路径下么

cjl-2000 commented 3 months ago

感谢您的作品分享!我是深度学习部署的新手,我遇到了如下所示的问题: cuda_problem 你好,我在 INITIAL ONNXRUNTIME ENV START报错 [ERROR] ONNXRuntime environment created failed : Load model from xxxx(一大串乱码),我看您也有类似的问题,请问您知道这里该怎么解决吗【定位到细节::ThrowStatus(st)函数报错】。

三个可能 cuda版本 cudnn没配,还有就是zlibwapi.dll没有

您好,我按照您的意见将三个方面都检查了,还是会出现乱码

你有把onnxruntime的dll都拷贝到可执行文件路径下么

image

对,包括zibwapi.dll都加入进去了,cuda版本为11.7,cudnn也配置了,onnxruntime用的1.15.0

GreatZeZuo commented 2 months ago

你好 我遇到了这个问题 [INFO] => inference start [INFO] => inference end1 < - -------- INFERENCEIMAGE START -------- -> [INFO] => PreProcess srcImage [INFO] Image info : width : 512 height : 5[ERROR] ONNXRuntime environment created failed : Load model from failed:Load model failed. File doesn't exist 12 [INFO] ExtractorType Superpoint turn RGB to Grayscale [INFO] Scale from 1 to 1 [INFO] => PreProcess destImage [INFO] Image info : width : 512 height : 512 我能够确认onnx的路径都是正确的 并且onnx文件没有损坏 我使用的是cpu进行推理

你好,请问你解决里面?我也是这个问题 image

GreatZeZuo commented 2 months ago

图像最终报错函数是ThrowOnError,this为空指针

您好,请问这个问题解决了吗,我也遇到了这个问题

你好,我和你的问题一样,请问你是怎么解决的呢? image

jiejiangd commented 1 month ago

图像最终报错函数是ThrowOnError,this为空指针

您好,请问这个问题解决了吗,我也遇到了这个问题

你好,我和你的问题一样,请问你是怎么解决的呢? image

您好请问您解决了吗,我也是这个问题,而且我是用cpu跑的,压根没有用到gpu