c++ SDK problem
See original GitHub issueI use c++ SDK in my server and use the command object_detection.exe cuda E:\\PycharmProjects\\mmdeploy_out\\mmdet\\faster_rcnn_r50_trt E:\\PycharmProjects\\mmdetection-master\\demo\\1.jpg
could successfully run ,but when I download the related code and compile success,I use same command ,it shows
[2022-08-10 13:12:34.783] [mmdeploy] [error] [model.cpp:44] no ModelImpl can read model D:/pythonProject/mmdeploy_out/mmdet/faster_rcnn_r50_trt [2022-08-10 13:12:34.784] [mmdeploy] [error] [model.cpp:15] load model failed. Its file path is 'D:/pythonProject/mmdeploy_out/mmdet/faster_rcnn_r50_trt' [2022-08-10 13:12:34.786] [mmdeploy] [error] [model.cpp:20] failed to create model: not supported (2) failed to create detector, code: 6
could you help me?
Should I disposition tensorRT environment in my computer with visual stusdio?
我在服务器上已经能够通过c++推理运行相关代码了,但是当我把trt模型文件下载到自己电脑,并且也下载其他相关代码而且编译成功没有报错了,在运行exe文件时,出现了上述报错。会不会是我在vs中没有配置tensorRT的问题呢?但是我在编译过程中并没有任何报错
Issue Analytics
- State:
- Created a year ago
- Comments:5
你可以研究一下mmdeploy的cmake工程,在编译example的时候,
mmdeploy_load_dynamic
其实是构建了一个loader,然后在exe中静态链接了一个函数,该函数使用LoadLibraryA去加载一些module的dll。You can study the cmake project of mmdeploy. When compiling the example,
mmdeploy_load_dynamic
statically link a loader to the exe. The loader uses LoadLibraryA to load some module dlls.https://github.com/open-mmlab/mmdeploy/blob/master/demo/csrc/CMakeLists.txt#L23 https://github.com/open-mmlab/mmdeploy/blob/master/cmake/MMDeploy.cmake#L161-L166 https://github.com/open-mmlab/mmdeploy/blob/master/cmake/loader.cpp.in
如果编译example的时候想脱离cmake的工程的话,可以在编译mmdeploy的时候,加上
-D MMDEPLOY_BUILD_SDK_MONOLITHIC=ON
选项,然后会生成一个mmdeploy.dll
的动态库,在生成exe的时候只链接这个dll就可以(之前的dll变成了mmdeploy.dll
的依赖,还是需要移动到项目文件夹或者添加PATH)If you want to build project without cmake when compiling the example, you can add the
-D MMDEPLOY_BUILD_SDK_MONOLITHIC=ON
option when compiling mmdeploy. It will generate dynamic library calledmmdeploy.dll
. When compile example, you only need to link that lib(the previous dll has become a dependency ofmmdeploy.dll
, and it still needs to be moved to the project folder or added to the PATH)可以参考这个issue的说明 https://github.com/open-mmlab/mmdeploy/issues/685