Smorodov / Multitarget-tracker

Multiple Object Tracker, Based on Hungarian algorithm + Kalman filter.
Apache License 2.0
2.19k stars 651 forks source link

link error when set BUILD_YOLO_TENSORRT=ON #251

Open MolianWH opened 4 years ago

MolianWH commented 4 years ago

Envs

Build code

cmake . .. -DUSE_OCV_BGFG=ON \
-DUSE_OCV_KCF=ON \
-DUSE_OCV_UKF=ON \
-DBUILD_YOLO_LIB=ON \
-DBUILD_YOLO_TENSORRT=ON \
-DBUILD_ASYNC_DETECTOR=ON \
-DBUILD_CARS_COUNTING=ON \
-DOpenCV_DIR=/usr/local/opencv-4.2.0/build  \
-DTensorRT_ROOT=/usr/local/TensorRT-7.1.3.4

And I also need to edite MULTIRARGET-TRACKER/src/Detector/tensorrt_yolo/CMakeLists.txt and add tensorrt path

SET(TensorRT_ROOT /usr/local/TensorRT-7.1.3.4)
SET(TensorRT_LIBRARY /usr/local/TensorRT-7.1.3.4/lib/libnvinfer.so.7) 
SET(TensorRT_INCLUDE_DIRS /usr/local/TensorRT-7.1.3.4/include)

Errors

Then make it and returns errors:

[ 97%] Linking CXX executable ../MultitargetTracker
../libyolo_rt_lib.so: undefined reference to `createInferRuntime_INTERNAL'
../libyolo_rt_lib.so: undefined reference to `getPluginRegistry'
../libyolo_rt_lib.so: undefined reference to `createInferBuilder_INTERNAL'
collect2: error: ld returned 1 exit status
example/CMakeFiles/MultitargetTracker.dir/build.make:183: recipe for target 'MultitargetTracker' failed
make[2]: *** [MultitargetTracker] Error 1
CMakeFiles/Makefile2:88: recipe for target 'example/CMakeFiles/MultitargetTracker.dir/all' failed
make[1]: *** [example/CMakeFiles/MultitargetTracker.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Other info

If I build with BUILD_YOLO_TENSORRT=OFF, it is successful. But when I run with ./MultitargetTracker ../data/atrium.avi -e=1 -o=../data/atrium_motion1.avi, there is no tarcking output (play origin video and output command about track is 0)

Nuzhny007 commented 4 years ago

Oh, error in CMakeLists.txt. As fast decision you can try: -DTensorRT_ROOT=/usr/local/TensorRT-7.1.3.4/*.so

Nuzhny007 commented 4 years ago

screenshot_mt_trt

MolianWH commented 4 years ago

@Nuzhny007 Thanks for your patient answer. I reinstalled TensorRT and tried many times, and it built successfully.