编译yolov5生成engine,报/tensorrtx/yolov5/yololayer.h:6:10: fatal error: NvInfer.h: No such file or directory 6 | #include <NvInfer.h>
| ^~~~~~~~~~~
compilation terminated.
1、未找到tensorRT对应的头文件和库。
在CMakeLists.txt
#tensorrt处添加tensorrt对应头文件和链接库
# tensorrt
#include_directories(/usr/include/x86_64-linux-gnu/)
#link_directories(/usr/lib/x86_64-linux-gnu/)
include_directories(/home/******/TensorRT-7.2.3.4/include)
link_directories(/home/******/TensorRT-7.2.3.4/lib/)