wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
7k stars 1.77k forks source link

yolov5-6.0在windows上编译报错无法解析的符号 #801

Closed futureflsl closed 3 years ago

futureflsl commented 3 years ago

VS2019 CUDA10.2 cudnn 7.6.5 TensorRT-7.0.0.11 编译6.0版本死活通不过,主要问题出在下 无法解析的外部符号 "void __cdecl preprocess_kernel_img(unsigned char ,int,int,float ,int,int,struct CUstream_st *)" (?preprocess_kernel_img@@YAXPEAEHHPEAMHHPEAUCUstream_st@@@Z),函数 main 中引用了该符号 yolov5 C:\Users\Administrator\Desktop\tensorrtx-windows\yolov5\build\yolov5.obj 1
开始和https://github.com/wang-xinyu/tensorrtx/issues/797 问题一样,加入add_definitions(-DAPI_EXPORTS)就变成这个报错

futureflsl commented 3 years ago

VS2019 CUDA10.2 cudnn 7.6.5 TensorRT-7.0.0.11 编译6.0版本死活通不过,主要问题出在下 无法解析的外部符号 "void __cdecl preprocess_kernel_img(unsigned char ,int,int,float ,int,int,struct CUstream_st *)" (?preprocess_kernel_img@@YAXPEAEHHPEAMHHPEAUCUstream_st@@@z),函数 main 中引用了该符号 yolov5 C:\Users\Administrator\Desktop\tensorrtx-windows\yolov5\build\yolov5.obj 1 开始和#797 问题一样,加入add_definitions(-DAPI_EXPORTS)就变成这个报错

I sovled it.I add add_executabe(yolov5 preprocess.cu preprocess.h)

raychiu0202 commented 2 years ago

VS2019 CUDA10.2 cudnn 7.6.5 TensorRT-7.0.0.11 编译6.0版本死活通不过,主要问题出在下 无法解析的外部符号 "void __cdecl preprocess_kernel_img(unsigned char ,int,int,float ,int,int,struct CUstream_st *)" (?preprocess_kernel_img@@YAXPEAEHHPEAMHHPEAUCUstream_st@@@z),函数 main 中引用了该符号 yolov5 C:\Users\Administrator\Desktop\tensorrtx-windows\yolov5\build\yolov5.obj 1 开始和#797 问题一样,加入add_definitions(-DAPI_EXPORTS)就变成这个报错

I sovled it.I add add_executabe(yolov5 preprocess.cu preprocess.h)

en~~It didn't work

raychiu0202 commented 2 years ago

VS2019 CUDA10.2 cudnn 7.6.5 TensorRT-7.0.0.11 编译6.0版本死活通不过,主要问题出在下 无法解析的外部符号 "void __cdecl preprocess_kernel_img(unsigned char ,int,int,float ,int,int,struct CUstream_st *)" (?preprocess_kernel_img@@YAXPEAEHHPEAMHHPEAUCUstream_st@@@z),函数 main 中引用了该符号 yolov5 C:\Users\Administrator\Desktop\tensorrtx-windows\yolov5\build\yolov5.obj 1 开始和#797 问题一样,加入add_definitions(-DAPI_EXPORTS)就变成这个报错

I sovled it.I add add_executabe(yolov5 preprocess.cu preprocess.h)

en~~It didn't work

I'm wrong. It works

tianyang820 commented 2 years ago

@raychiu0202 Hi. How did you solve it?

raychiu0202 commented 2 years ago

@raychiu0202 Hi. How did you solve it?

我记得是按照上边那个futureflsl兄弟方式处理的,配置一下yolov5 preprocess.cu preprocess.h这两个文件就可以了。

hzhangxwow commented 2 years ago

need to added in the previous line like this add_executable(yolov5 ${PROJECT_SOURCE_DIR}/yolov5.cpp ${PROJECT_SOURCE_DIR}/yololayer.cu ${PROJECT_SOURCE_DIR}/yololayer.h yolov5 ${PROJECT_SOURCE_DIR}/preprocess.cu ${PROJECT_SOURCE_DIR}/preprocess.h) #4

Ryan-Y25 commented 1 month ago

need to added in the previous line like this add_executable(yolov5 ${PROJECT_SOURCE_DIR}/yolov5.cpp ${PROJECT_SOURCE_DIR}/yololayer.cu ${PROJECT_SOURCE_DIR}/yololayer.h yolov5 ${PROJECT_SOURCE_DIR}/preprocess.cu ${PROJECT_SOURCE_DIR}/preprocess.h) #4

This way works!