OpenCV4.4.0 With OpenVINO打包釋出的異常問題記錄
技術標籤:C++
0.開發環境:
QT5.9
加入了openvino的opencv4.4.0
專案在QT中開發完成後,打包釋出(使用windeployqt載入qt相關的依賴),在其他電腦上執行時出現問題,主要是缺少動態連結庫。
問題1. 缺少ngraph.dll、tbb.dll
解決辦法:
到
C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\ngraph\lib
和
C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\inference_engine\external\tbb\bin
下複製對應檔案到程式執行目錄下
問題2.缺少引擎dll動態連結庫檔案
解決辦法:
到C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\inference_engine\bin\intel64\Release
下複製相應動態連結庫檔案到程式執行目錄下
問題3.缺少其他檔案
解決辦法:
到C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
下複製相應動態連結庫檔案到程式執行目錄下
問題4.無法定位輸入點
無法定位輸入點nanf於動態連結庫 ngraph.dll上
原因:缺少動態連結庫
解決辦法:
到
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
目錄下複製檔案libmmd.dll到程式執行目錄下。
問題5.Error loading XML file: …\plugins.xml:
OpenCV: terminate handler is called! The last OpenCV error is: OpenCV(4.4.0) Error: Unspecified error (Failed to initialize Inference Engine backend (device = CPU): Error loading XML file: D:\hahahha\plugins.xml:1:0: File was not found) in cv::dnn::InfEngineNgraphNet::initPlugin, file C:\Users\lenovo\Desktop\opencv440\modules\dnn\src\ie_ngraph.cpp, line 692
解決辦法:
到C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\inference_engine\bin\intel64\Release
目錄下複製檔案plugins.xml
到程式執行目錄下。
問題6.無法載入MKLDNNPlugin.dll
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.4.0) Error: Unspecified error (> Failed to initialize Inference Engine backend (device = CPU): Failed to create plugin MKLDNNPlugin.dll for device CPU
> Please, check your environment
> Cannot load library 'MKLDNNPlugin.dll': 126 from cwd: D:\hahahha
> ) in cv::dnn::InfEngineNgraphNet::initPlugin, file C:\Users\lenovo\Desktop\opencv440\modules\dnn\src\ie_ngraph.cpp, line 692
解決辦法:
到C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\inference_engine\bin\intel64\Release
目錄下複製檔案MKLDNNPlugin.dll
到程式執行目錄下。
問題7.無法載入MKLDNNPlugin.dll
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.4.0) Error: Unspecified error (> Failed to initialize Inference Engine backend (device = CPU): Failed to create plugin D:\hahahha\MKLDNNPlugin.dll for device CPU
> Please, check your environment
> Cannot load library 'D:\hahahha\MKLDNNPlugin.dll': 126 from cwd: D:\hahahha
> ) in cv::dnn::InfEngineNgraphNet::initPlugin, file C:\Users\lenovo\Desktop\opencv440\modules\dnn\src\ie_ngraph.cpp, line 692
注意,問題7和問題6提示的錯誤資訊不同,問題7中提示的錯誤中有路徑資訊。
解決辦法:
到C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\inference_engine\bin\intel64\Release
目錄下複製檔案inference_engine_lp_transformations.dll
到程式執行目錄下。
其他問題
如果在IDE環境下一切正常,打包釋出後,無法正常執行。
原因很可能是缺失
C:\Program Files (x86)\IntelSWTools\openvino_2020.4.287\deployment_tools\inference_engine\bin\intel64\Release
目錄下的dll檔案,或者是
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
下的dll檔案。其實可以全都複製,haha
參考了:https://blog.csdn.net/weixin_39956356/article/details/107518878