TensorRT-Alpha FAQ

1、linux下出现错误:

libyolov8.so: undefined reference to `sample::splitToStringVec(std::__cxx11::basic_string, std::allocator > const&, char)'
collect2: error: ld returned 1 exit status
CMakeFiles/app_yolov8.dir/build.make:147: recipe for target 'app_yolov8' failed
make[2]: *** [app_yolov8] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/app_yolov8.dir/all' failed
make[1]: *** [CMakeFiles/app_yolov8.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

原因:仓库默认tensorrt8.4.2.4,你使用了更新版本,如:tensorrt8.6.1.6

解决:修改cmakelist就行,sample::splitToStringVec函数在文件:/samples/common/sampleUtils.cpp,所以这里直接在原来cmakelists中增加这个文件就行,如下图:

TensorRT-Alpha FAQ_第1张图片

重新make编译之后,通过:

TensorRT-Alpha FAQ_第2张图片

2、报错:[12/27/2023-19:14:50] [E] [TRT] 3: [runtime.cpp::nvinfer1::Runtime::~Runtime::346] Error Code 3: API Usage Error (Parameter check failed at: runtime.cpp::nvinfer1::Runtime::~Runtime::346, condition: mEngineCounter.use_count() == 1. Destroying a runtime before destroying deserialized engines created by the runtime leads to undefined behavior.
)

问题:推理的时候报这个错误。

解决:这是由于runtime释放了而eigen没有释放;一般声明顺序为:runtime -> eigen -> context,所以释放顺序反过来

你可能感兴趣的:(AI科普,linux)