mmdeploy
mmdeploy copied to clipboard
a problem occured when calling mmdeploy_detector_create_by_path
C++When I call the function mmdeploy_detector_create,The return value is 6。 route There are .engine file and .onnx file,What's the next step? Please ask everyone. Thank you
@lvhan028
MMDeploy Is there a problem with the environment? @lvhan028
Please share the arguments when calling the API. Probably because the model_path
is wrong, using SDK model path, which is the directory you passed to --work-dir
C + + code parameters are as follows: const char* model_path = "D:\YQL4\mmdeploy\work_dir"; int status{}; mmdeploy_detector_t detector{}; status = mmdeploy_detector_create_by_path(model_path, device_name, 0, &detector); //status = 6; if (status != MMDEPLOY_SUCCESS ) { fprintf(stderr, "failed to create detector, code: %d\n", (int)status); return 1; } model_ Path has the following files: end2end.engine、end2end.onnx Where should I continue to investigate?Thank you, boss
Have you converted the model with --dump-info
?
It is supposed to have deploy.json
and pipeline.json
in D:\YQL4\mmdeploy\work_dir
Thank you very much. The new file is as follows:
- deploy.json
- detail.json
- pipeline.json But mmdeploy_ detector_ create_ by_ The return value of path is still 6 Is there any other influence?boss
The C + + running log is as follows: [2022-09-05 15:46:36.515] [mmdeploy] [info] [model.cpp:95] Register 'DirectoryModel' [2022-09-05 15:46:37.693] [mmdeploy] [info] [model.cpp:38] DirectoryModel successfully load model D:\YQL4\mmdeploy\work_dir [2022-09-05 15:46:37.694] [mmdeploy] [error] [device_impl.cpp:147] 0, -1 [2022-09-05 15:46:37.696] [mmdeploy] [error] [pipeline.cpp:27] exception caught: invalid argument (1) failed to create detector, code: 6 @lvhan028
the same error
"[2022-09-05 15:46:37.694] [mmdeploy] [error] [device_impl.cpp:147] 0, -1" Have you built mmdeploy SDK? How did you integrate mmdeploy libs to your project? Could you kindly provide reproducing steps? I cannot reproduce your issue now.
@lvhan028 Boss,The SDK is built as follows:
- https://github.com/open-mmlab/mmdeploy/blob/master/docs/en/01-how-to-build/windows.md ,First get opencv pplcv
- https://github.com/open-mmlab/mmdeploy/blob/master/docs/en/02-how-to-run/prebuilt_package_windows.md#tensorrt-3 , Generate exe executor with the path given by tensorrt
- C + + calls these exe programs with shellexecute a function C + + dependent library files include:
C:\Users\Administrator\source\repos\C++_And_Python\mmdeploy-0.7.0-windows-amd64-cuda11.1-tensorrt8.2.3.0\sdk\lib mmdeploy.lib; mmdeploy_classifier.lib; mmdeploy_common.lib; mmdeploy_core.lib; mmdeploy_cpu_device.lib; mmdeploy_cpu_transform_impl.lib;mmdeploy_detector.lib; mmdeploy_directory_model.lib; mmdeploy_execution.lib; mmdeploy_executor.lib; mmdeploy_graph.lib; mmdeploy_mmcls.lib; mmdeploy_mmdet.lib; mmdeploy_mmedit.lib; mmdeploy_mmocr.lib; mmdeploy_mmpose.lib; mmdeploy_mmrotate.lib; mmdeploy_mmseg.lib; mmdeploy_model.lib; mmdeploy_net_module.lib; mmdeploy_opencv_utils.lib; mmdeploy_pipeline.lib; mmdeploy_pose_detector.lib; mmdeploy_restorer.lib; mmdeploy_rotated_detector.lib; mmdeploy_segmentor.lib; mmdeploy_text_detector.lib; mmdeploy_text_recognizer.lib; mmdeploy_transform.lib; mmdeploy_transform_module.lib; spdlog.lib; nvinfer.lib; opencv_world460.lib; Is there any other influence? boss@lvhan028
“[2022-09-05 15:46:37.694] [mmdeploy] [error] [device_impl.cpp:147] 0, -1” 您是否构建了 mmdeploy SDK?您是如何将 mmdeploy 库集成到您的项目中的? 您能否提供复制步骤?我现在无法重现您的问题。
@lvhan028 Boss,The SDK is built as follows:
- https://github.com/open-mmlab/mmdeploy/blob/master/docs/en/01-how-to-build/windows.md ,First get opencv pplcv
- https://github.com/open-mmlab/mmdeploy/blob/master/docs/en/02-how-to-run/prebuilt_package_windows.md#tensorrt-3 , Generate exe executor with the path given by tensorrt
- C + + calls these exe programs with shellexecute a function Is there any other influence? boss@lvhan028
C + + dependent library files include:
C:\Users\Administrator\source\repos\C++_And_Python\mmdeploy-0.7.0-windows-amd64-cuda11.1-tensorrt8.2.3.0\sdk\lib mmdeploy.lib; mmdeploy_classifier.lib; mmdeploy_common.lib; mmdeploy_core.lib; mmdeploy_cpu_device.lib; mmdeploy_cpu_transform_impl.lib;mmdeploy_detector.lib; mmdeploy_directory_model.lib; mmdeploy_execution.lib; mmdeploy_executor.lib; mmdeploy_graph.lib; mmdeploy_mmcls.lib; mmdeploy_mmdet.lib; mmdeploy_mmedit.lib; mmdeploy_mmocr.lib; mmdeploy_mmpose.lib; mmdeploy_mmrotate.lib; mmdeploy_mmseg.lib; mmdeploy_model.lib; mmdeploy_net_module.lib; mmdeploy_opencv_utils.lib; mmdeploy_pipeline.lib; mmdeploy_pose_detector.lib; mmdeploy_restorer.lib; mmdeploy_rotated_detector.lib; mmdeploy_segmentor.lib; mmdeploy_text_detector.lib; mmdeploy_text_recognizer.lib; mmdeploy_transform.lib; mmdeploy_transform_module.lib; spdlog.lib; nvinfer.lib; opencv_world460.lib;
There is no 'mmdeploy_cuda_device.lib' or 'mmdeploy_trt_net.lib' or 'mmdeploy_ort_net.lib' Please using exact the following command to build mmdeploy from source.
Make sure to set option -DMMDEPLOY_TARGET_DEVICES="cpu;cuda"
cd $env:MMDEPLOY_DIR
mkdir build -ErrorAction SilentlyContinue
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 `
-DMMDEPLOY_BUILD_SDK=ON `
-DMMDEPLOY_BUILD_EXAMPLES=ON `
-DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
-DMMDEPLOY_TARGET_DEVICES="cpu;cuda" `
-DMMDEPLOY_TARGET_BACKENDS="trt" `
-Dpplcv_DIR="$env:PPLCV_DIR/pplcv-build/install/lib/cmake/ppl" `
-DTENSORRT_DIR="$env:TENSORRT_DIR" `
-DCUDNN_DIR="$env:CUDNN_DIR"
cmake --build . --config Release -- /m
cmake --install . --config Release
@lvhan028 Boss,The method you recommend will be missing 'mmdeploy_ort_net.lib' The commands I use are as follows:
- cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 -DMMDEPLOY_TARGET_BACKENDS="trt" -DTENSORRT_DIR="C:\Program Files\NVIDIA GPU Computing Toolkit\tensorrt\TensorRT-8.4.3.1" -DCUDNN_DIR="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3"
- cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 -DMMDEPLOY_BUILD_SDK=ON -DMMDEPLOY_BUILD_EXAMPLES=ON -DMMDEPLOY_BUILD_SDK_PYTHON_API=OFF -DMMDEPLOY_BUILD_SDK_CXX_API=ON -DMMDEPLOY_TARGET_DEVICES="cuda" -DMMDEPLOY_TARGET_BACKENDS="trt" -Dpplcv_DIR="D:\YQL4\ppl.cv\pplcv-build\install\lib\cmake\ppl" -DTENSORRT_DIR="C:\Program Files\NVIDIA GPU Computing Toolkit\tensorrt\TensorRT-8.4.3.1" -DCUDNN_DIR="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3" Is there a problem with my operation?Please give me more advice,Thank you
@lvhan028 Boss,From your professional perspective, do you recommend a detailed tutorial of C++connection model? I will deploy it according to the tutorial. Thank you, boss
Sorry for being late. When you use the prebuild package, this is no need to build mmdeploy from source. The command you are using is right. @irexyc could you help investigating this issue?
@IronManTwo
看了你上面的回复,感觉有一些乱,根据路径mmdeploy-0.7.0-windows-amd64-cuda11.1-tensorrt8.2.3.0\sdk\lib
似乎你用到了预编译包,但是你给的lib目录下面又出现了opencv_world460.lib, nvinfer.lib等预编译包中没有的文件,另外不知道你的example是怎么编译的。预编译包中的bin目录下的相关exe可以跑你转的模型么?
方便通过Openmmlab小喵加一下mmdpeloy的微信群,然后群里聊么,效率高一些。 https://github.com/open-mmlab/mmdeploy/blob/master/README_zh-CN.md
This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.
This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.