linghu8812 / tensorrt_inference

707 stars 208 forks source link

make -j Error with yolov5 #94

Closed abuelgasimsaadeldin closed 3 years ago

abuelgasimsaadeldin commented 3 years ago

Hi, after successfully converting my yolov5s model to onnx I ran into the following error message when trying to run the "make" command:

skymind@skymind:~/yolov5-tensorrt-linghu/yolov5/build$ make -j
Scanning dependencies of target yolov5_trt
[ 33%] Building CXX object CMakeFiles/yolov5_trt.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/yolov5_trt.dir/yolov5.cpp.o
[100%] Linking CXX executable yolov5_trt
/usr/bin/ld: skipping incompatible /home/skymind/yolov5-tensorrt-linghu/yolov5/../includes/yaml-cpp/libs/libyaml-cpp.a when searching for -lyaml-cpp
/usr/bin/ld: cannot find -lyaml-cpp
collect2: error: ld returned 1 exit status
CMakeFiles/yolov5_trt.dir/build.make:139: recipe for target 'yolov5_trt' failed
make[2]: * [yolov5_trt] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/yolov5_trt.dir/all' failed
make[1]: * [CMakeFiles/yolov5_trt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: * [all] Error 2

Any help or suggestion in solving this would be highly appreciated. Thanks you.

hirahara-taiki commented 3 years ago

@abuelgasimsaadeldin Hi, I met the same issue. (make -j Error with yolov4, to be exact) I think the file libyaml-cpp.a was created on the device different from yours. So, I've tryed to create the static library file on my device. (I tryed sudo apt install libyaml-cpp-dev, but it haven't work well.)

git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
cd build
cmake ..
make -j

After these commands, I've replaced the file tensorrt_inference/common/includes/yaml-cpp/libs/libyaml-cpp.a and the directory tensorrt_inference/common/includes/yaml-cpp/include/yaml-cpp with the file yaml-cpp/build/libyaml-cpp.a(created now) and the directory yaml-cpp/include/yaml-cpp. Then the make -j command went through.

abuelgasimsaadeldin commented 3 years ago

Hi @hirahara-taiki, thank you so much, just tried it out and it works!