DanaHan / Yolov5-in-Deepstream-5.0

Describe how to use yolov5 in Deepstream 5.0
209 stars 57 forks source link

I created a new branch that support tensorrt7 #32

Closed Abandon-ht closed 1 year ago

Abandon-ht commented 2 years ago

https://github.com/Abandon-ht/Yolov5-in-Deepstream-5.0/tree/tensorrt7

sxj731533730 commented 2 years ago

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

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)

raychiu0202 commented 2 years ago

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

oloPlugins.h:74:9: 错误:'int YoloLayerV3::enqueue(int, const void const, void const, void, cudaStream_t)' 标记为 'override',但不覆盖 74 | int enqueue ( | ^~~ yoloPlugins.h: 在成员函数 'virtual nvinfer1::IPluginV2 YoloLayerV3PluginCreator::deserializePlugin(const char, const void, size_t)': yoloPlugins.h:122:56:错误:抽象类类型 'YoloLayerV3' 122 的无效新表达式| return new YoloLayerV3(serialData, serialLength); | ^ yoloPlugins.h:50:7: 注意:因为以下虚函数在 'YoloLayerV3' 中是纯的: 50 | YoloLayerV3 类:公共 nvinfer1::IPluginV2 | ^~~ 在从../includes/NvInferRuntime.h:59包含的文件, 从../includes/NvInfer.h:53, 从yolo.h:31, 从yolo.cpp:23: ../includes/NvInferRuntimeCommon.h: 560:21:注意:'虚拟 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 input, void* output , void workspace, | ^~~ yolo.cpp: 在成员函数 'nvinfer1::ICudaEngine Yolo::createEngine(nvinfer1 ::IBuilder)': yolo.cpp:72:12: 错误:'virtual nvinfer1::IBuilderConfig::~IBuilderConfig()' 在此上下文中受到保护 72 | 删除配置; | ^~ 在包含的文件中来自 yolo.h:31, 来自 yolo.cpp:23: ../includes/NvInfer.h:6756:13: 注意:此处声明受保护 6756 | 虚拟 ~IBuilderConfig() {} | ^ yolo.cpp:在成员函数“NvDsInferStatus Yolo::buildYoloNetwork(std::vector&, nvinfer1::INetworkDefinition&)”中: yolo.cpp:178:81:错误:抽象类类型“YoloLayerV3”的新表达式无效 178 | m_OutputTensors.at(outputTensorCount).gridSize); | ^

make: *** [Makefile:50: yolo.o] 错误 1

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

我的是2060 cuda10.2 trt7.0 deepstream5.0 也是遇到这种错误了,你的解决了没有呢

Pray9527 commented 2 years ago

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

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)

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

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) 请问 已经解决了吗

Pray9527 commented 2 years ago

我也是报这个错误,请问解决了吗