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

执行找不到OpenVinoSharp.dll #1

Open
QuietMinder opened this issue Sep 24, 2022 · 5 comments
Open

执行找不到OpenVinoSharp.dll #1

QuietMinder opened this issue Sep 24, 2022 · 5 comments

Comments

@QuietMinder
Copy link

你好 配置完成后可以生成OpenVinoSharp.dll,调用出错,无法找到改DLL. 需要复制哪些依赖dll吗?

@guojin-yan
Copy link
Owner

注意修改一下NativeMethods.cs文件中该dll文件的路径,该位置我采用的是绝对路径

@QuietMinder
Copy link
Author

已经采用了绝对路径Unhandled exception. System.DllNotFoundException: Unable to load DLL 'E:\OpenVino\Csharp_and_OpenVINO_deploy_PaddleOCR\PaddleOCR文字识别\bin\Release\net6.0\OpenVinoSharp.dll' or one of its dependencies: 找不到指定的模块。 (0x8007007E)
at OpenVinoSharpPaddleOCR.NativeMethods.core_init(String model_file, String device_name)
at OpenVinoSharpPaddleOCR.PaddleOCR.paddleocr_openvino() in E:\OpenVino\Csharp_and_OpenVINO_deploy_PaddleOCR\PaddleOCR文字识别\PaddleOCR.cs:line 43
at OpenVinoSharpPaddleOCR.Program.Main(String[] args) in E:\OpenVino\Csharp_and_OpenVINO_deploy_PaddleOCR\PaddleOCR文字识别\Program.cs:line 11

@guojin-yan
Copy link
Owner

你查看一下你的依赖项是否设置正确,openvino和opencv的,由于项目生成的是动态链接库,在生成时看不出来错误,在使用的时候会有错误。你可以尝试在生成dll的项目里,增加一个main函数,将项目改为生成exe文件,调用模型加载接口这个函数,看看是否有错误。

@QuietMinder
Copy link
Author

配置了cv4.55 和 4.6都可以一次性生成dll,然后我该dll复制到C#生成的exe目录下 同时复制了openvino.dll和opencv_world460.dll 执行发现出错是在
public Core(string model_file, string device_name){
// 初始化推理核心
ptr = NativeMethods.core_init(model_file, device_name); //这里错了 dll路径是对的
}

@guojin-yan
Copy link
Owner

留个联系方式,我加你,给你远程一下

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