Closed HXB-1997 closed 1 year ago
Hello,
Looks like you are missing opencv_contib includes. How did you get opencv(build from sources or distributed packages)? If you want more help please provide some system informations and take a look at https://github.com/cyrusbehr/tensorrt-cpp-api/blob/main/scripts/build_opencv.sh it may help you solving what i think your issue may be.
Best regards
@YumainOB is correct. Please be sure to compile OpenCV with CUDA support. Follow the instructions in the readme file:
If you confirm that you have compiled OpenCV with CUDA support and still have issues, please reopen this issue.
@cyrusbehr @YumainOB thank you so much. I'll have a try.
@HXB-1997 @cyrusbehr anyone have fixed this issue? I have tried both install opencv by another package and the script build_opencv.sh but I still have this issue.
@huynhkhoa44 can you provide more info on the issue you are facing. What is the error?
@cyrusbehr I want to use script build_opencv.sh. I follow the instruction and modify my path to CUDNN LIBRARY and CUDNN INCLUDE DIR.
And I run this file
And this is my error
After error when use this code, I try to install opencv with CUDA by this link: https://www.youtube.com/watch?v=X6cXBqIz464. After install succesful, I build the project. But it has error like this issue when I run "make -j 8"
@huynhkhoa44
Look at the screenshot you uploaded. Your OpenCV build script is failing:
You can't proceed with building the project until you first build OpenCV properly.
You probably need to modify these two arguments so that they point to the installation location of CUDNN on your system (I'm betting if you checked, those directories specified don't exist).
Find our where your CUDNN is installed to. Once you'd done that, update the CUDNN_INCLUDE_DIR
and CUDNN_LIBRARY
arguments and rebuild OpenCV. If the build script still fails, then we can try to work to solve the issue.
(CUDA113+CUDNN82) han@han:~/Desktop/hxb_projects/CPP_Instance/10-31/git-2/YOLOv8-TensorRT-CPP/build$ make [ 8%] Building CXX object libs/tensorrt-cpp-api/CMakeFiles/tensorrt_cpp_api.dir/src/engine.cpp.o /home/han/Desktop/hxb_projects/CPP_Instance/10-31/git-2/YOLOv8-TensorRT-CPP/libs/tensorrt-cpp-api/src/engine.cpp:7:10: fatal error: opencv2/cudaimgproc.hpp: No such file or directory 7 | #include <opencv2/cudaimgproc.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [libs/tensorrt-cpp-api/CMakeFiles/tensorrt_cpp_api.dir/build.make:76: libs/tensorrt-cpp-api/CMakeFiles/tensorrt_cpp_api.dir/src/engine.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:215: libs/tensorrt-cpp-api/CMakeFiles/tensorrt_cpp_api.dir/all] Error 2 make: *** [Makefile:91: all] Error 2