Closed B1SH0PP closed 7 months ago
试下FP32 或者试试TensorRT 8.4
试下FP32 或者试试TensorRT 8.4
您好! 很高兴真的能收到您的回复! 改为FP32是只要改这里吗?
我目前改好后, 重新编译, 重新生成了wts
和engine
文件, 测试下来依然没有效果.
改tensorRT 8.4x
的版本可能会有点麻烦, 我看我目前装的cuda11.7
不支持tensorRT8.4x
版本, 这可能会有点耗时, 我待会儿测试下, 我不清楚cuda
是否会有版本冲突, 是否得卸载干净.
@wang-xinyu
如果是1060,那加下61 arch试试 set(CMAKE_CUDA_ARCHITECTURES 61 75 86 89)
@wang-xinyu 成功了! 太有实力了哥!
@wang-xinyu 您好,我也遇到这个问题,我环境是: GPU: GTX3050 OS: WSL2 Ubuntu20.04 Cuda version: 11.6 TensorRT version: TensorRT-8.4.1.5 按照您上面的方法还是没有解决问题,请问这是咋回事么?
WSL2这种野路子尽量避免,找一个正经ubuntu系统试试
给力, 一直没找到问题,果然是cuda的arch配置问题!!
Env
About this repo
Your problem
使用了yolov5官网的预训练权重yolov5s_v7.0, 并使用该仓库提供的脚本生成
.wts
文件, 最后生成了.engine
, 但是运行后没有目标框, 测试了10多张一个目标都没检测出来. 中途过程中也没有报错啊?add_definitions(-w) # 关闭警告信息输出 add_definitions(-std=c++11) add_definitions(-DAPI_EXPORTS) set(CMAKE_CXX_STANDARD 11) set(CMAKE_BUILD_TYPE Debug) set(CMAKE_CUDA_ARCHITECTURES 75 86 89) set(THREADS_PREFER_PTHREAD_FLAG ON)
nvcc
set(CMAKE_CUDA_COMPILER "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe") enable_language(CUDA)
cuda
include_directories("C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include") link_directories("C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/lib/x64")
tensorrt
set(TRT_DIR "C:/Program Files/NVIDIA GPU Computing Toolkit/TensorRT-8.5.3.1/") include_directories(${TRT_DIR}/include) link_directories(${TRT_DIR}/lib)
opencv
set(OpenCV_DIR "C:/SDK/OpenCV/OpenCV_4.6.0/opencv/build/") find_package(OpenCV) include_directories(${OpenCV_INCLUDE_DIRS})
dirent
include_directories("C:/SDK/dirent-1.24")
include_directories("C:/SDK/dirent-1.24/include")
include_directories(${PROJECT_SOURCE_DIR}/src/) include_directories(${PROJECT_SOURCE_DIR}/plugin/) file(GLOB_RECURSE SRCS ${PROJECT_SOURCE_DIR}/src/.cpp ${PROJECT_SOURCE_DIR}/src/.cu) file(GLOB_RECURSE PLUGIN_SRCS ${PROJECT_SOURCE_DIR}/plugin/*.cu) add_library(myplugins SHARED ${PLUGIN_SRCS}) target_link_libraries(myplugins nvinfer cudart)
add_executable(yolov5_det "./yolov5_det.cpp" ${SRCS}) target_link_libraries(yolov5_det nvinfer cudart nvinfer_plugin myplugins ${OpenCV_LIBS})