DanaHan / Yolov5-in-Deepstream-5.0

Describe how to use yolov5 in Deepstream 5.0
208 stars 56 forks source link

在 Deepstream 5.0/nvdsinfer_custom_impl_Yolo 目录中运行 make 编译,生成 libnvdsinfer_custom_impl_Yolo.so 文件; 遇到错误 #33

Closed sxj731533730 closed 2 years ago

sxj731533730 commented 2 years ago

oloPlugins.h:74:9: error: ‘int YoloLayerV3::enqueue(int, const void const, void const, void, cudaStream_t)’ marked ‘override’, but does not override 74 | int enqueue ( | ^~~ yoloPlugins.h: In member function ‘virtual nvinfer1::IPluginV2 YoloLayerV3PluginCreator::deserializePlugin(const char, const void, size_t)’: yoloPlugins.h:122:56: error: invalid new-expression of abstract class type ‘YoloLayerV3’ 122 | return new YoloLayerV3(serialData, serialLength); | ^ yoloPlugins.h:50:7: note: because the following virtual functions are pure within ‘YoloLayerV3’: 50 | class YoloLayerV3 : public nvinfer1::IPluginV2 | ^~~ In file included from ../includes/NvInferRuntime.h:59, from ../includes/NvInfer.h:53, from yolo.h:31, from yolo.cpp:23: ../includes/NvInferRuntimeCommon.h:560:21: note: ‘virtual int32_t nvinfer1::IPluginV2::enqueue(int32_t, const void const, void*, void, cudaStream_t)’ 560 | virtual int32_t enqueue(int32_t batchSize, const void const inputs, void* outputs, void workspace, | ^~~ yolo.cpp: In member function ‘nvinfer1::ICudaEngine Yolo::createEngine(nvinfer1::IBuilder)’: yolo.cpp:72:12: error: ‘virtual nvinfer1::IBuilderConfig::~IBuilderConfig()’ is protected within this context 72 | delete config; | ^~ In file included from yolo.h:31, from yolo.cpp:23: ../includes/NvInfer.h:6756:13: note: declared protected here 6756 | virtual ~IBuilderConfig() {} | ^ yolo.cpp: In member function ‘NvDsInferStatus Yolo::buildYoloNetwork(std::vector&, nvinfer1::INetworkDefinition&)’: yolo.cpp:178:81: error: invalid new-expression of abstract class type ‘YoloLayerV3’ 178 | m_OutputTensors.at(outputTensorCount).gridSize); | ^

make: *** [Makefile:50: yolo.o] Error 1

我使ubuntu20.04 RTX2060 deepstream-5.1 cuda-11.1+Tensorrt7.2.2 编译 最后一步还是遇到了错误(Makefile中的cuda-11.3已经更改成cuda-11.1)

willosonico commented 2 years ago

same here

willosonico commented 2 years ago

btw, i had to change cuda version in Makefile to

CUDA_VER?=10.2

maybe this could be the problem?

zjxyztx commented 2 years ago

me too (jetson nano 4.5.1, ubuntu18.0, tensorrt7.1, deepstream5.1, (i have NOT done anything, just cd nvdsinfer_custom_impl_Yolo/ and make.

zjxyztx commented 2 years ago

i have changed cuda version in makefile

jiangzhen3s commented 2 years ago

我也没编译通过。。。 我Jetson nano 是CUDA_VER?=10.2 但是设置后会有其他的错误

Programmerwyl commented 2 years ago

deepstream version 5.1 jetson tx2 CUDA_VER=10.2

Because yolov5 doesn't use all the files under nvdsinfer_custom_impl_Yolo, you can comment out some of the files and then you're ready to run

SRCFILES:= nvdsinfer_yolo_engine.cpp \ nvdsparsebbox_Yolo.cpp \ trt_utils.cpp \

yoloPlugins.cpp

willosonico commented 2 years ago

deepstream version 5.1 jetson tx2 CUDA_VER=10.2

Because yolov5 doesn't use all the files under nvdsinfer_custom_impl_Yolo, you can comment out some of the files and then you're ready to run

SRCFILES:= nvdsinfer_yolo_engine.cpp nvdsparsebbox_Yolo.cpp trt_utils.cpp # yoloPlugins.cpp

this worked for me, thanks

sxj731533730 commented 2 years ago

i have come my aims using deepstream5.0===》 pc_x86_64: https://blog.csdn.net/sxj731533730/article/details/121305007