wang-xinyu / tensorrtx

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

Building yolov5 successfully, but making yolov3/v4 failed. #705

Closed YuanZhichao closed 3 years ago

YuanZhichao commented 3 years ago

I have built yolov5 successfully but error raised when making yolov3 or yolov4:

[ 20%] Building NVCC (Device) object CMakeFiles/yololayer.dir/yololayer_generated_yololayer.cu.o /home/yzc/Projects/tensorrtx/yolov3/yololayer.h(73): error: member function declared with "override" does not override a base class member

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(73): warning: function "nvinfer1::IPluginV2::enqueue(int32_t, const void const , void const , void *, cudaStream_t)" is hidden by "nvinfer1::YoloLayerPlugin::enqueue" -- virtual function override intended?

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(104): warning: function "nvinfer1::IPluginV2Ext::configurePlugin(const nvinfer1::Dims , int32_t, const nvinfer1::Dims , int32_t, const nvinfer1::DataType , const nvinfer1::DataType , const __nv_bool , const __nv_bool , nvinfer1::PluginFormat, int32_t)" is hidden by "nvinfer1::YoloLayerPlugin::configurePlugin" -- virtual function override intended?

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(106): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::detachFromContext" is incompatible with that of overridden function "nvinfer1::IPluginV2Ext::detachFromContext"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(104): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::configurePlugin" is incompatible with that of overridden function "nvinfer1::IPluginV2IOExt::configurePlugin(const nvinfer1::PluginTensorDesc , int32_t, const nvinfer1::PluginTensorDesc , int32_t)"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(101): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::attachToContext" is incompatible with that of overridden function "nvinfer1::IPluginV2Ext::attachToContext"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(99): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::canBroadcastInputAcrossBatch" is incompatible with that of overridden function "nvinfer1::IPluginV2Ext::canBroadcastInputAcrossBatch"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(97): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::isOutputBroadcastAcrossBatch" is incompatible with that of overridden function "nvinfer1::IPluginV2Ext::isOutputBroadcastAcrossBatch"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(95): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getOutputDataType" is incompatible with that of overridden function "nvinfer1::IPluginV2Ext::getOutputDataType"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(93): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getPluginNamespace" is incompatible with that of overridden function "nvinfer1::IPluginV2::getPluginNamespace"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(91): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::setPluginNamespace" is incompatible with that of overridden function "nvinfer1::IPluginV2::setPluginNamespace"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(89): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::clone" is incompatible with that of overridden function "nvinfer1::IPluginV2Ext::clone"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(89): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::clone" is incompatible with that of overridden function "nvinfer1::IPluginV2::clone"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(87): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::destroy" is incompatible with that of overridden function "nvinfer1::IPluginV2::destroy"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(85): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getPluginVersion" is incompatible with that of overridden function "nvinfer1::IPluginV2::getPluginVersion"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(83): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getPluginType" is incompatible with that of overridden function "nvinfer1::IPluginV2::getPluginType"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(79): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::supportsFormatCombination" is incompatible with that of overridden function "nvinfer1::IPluginV2IOExt::supportsFormatCombination"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(77): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::serialize" is incompatible with that of overridden function "nvinfer1::IPluginV2::serialize"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(75): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getSerializationSize" is incompatible with that of overridden function "nvinfer1::IPluginV2::getSerializationSize"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(71): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getWorkspaceSize" is incompatible with that of overridden function "nvinfer1::IPluginV2::getWorkspaceSize"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(69): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::terminate" is incompatible with that of overridden function "nvinfer1::IPluginV2::terminate"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(67): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::initialize" is incompatible with that of overridden function "nvinfer1::IPluginV2::initialize"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(65): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getOutputDimensions" is incompatible with that of overridden function "nvinfer1::IPluginV2::getOutputDimensions"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(60): error: exception specification for virtual function "nvinfer1::YoloLayerPlugin::getNbOutputs" is incompatible with that of overridden function "nvinfer1::IPluginV2::getNbOutputs"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(139): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::getPluginNamespace" is incompatible with that of overridden function "nvinfer1::IPluginCreator::getPluginNamespace"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(134): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::setPluginNamespace" is incompatible with that of overridden function "nvinfer1::IPluginCreator::setPluginNamespace"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(132): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::deserializePlugin" is incompatible with that of overridden function "nvinfer1::IPluginCreator::deserializePlugin"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(130): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::createPlugin" is incompatible with that of overridden function "nvinfer1::IPluginCreator::createPlugin"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(128): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::getFieldNames" is incompatible with that of overridden function "nvinfer1::IPluginCreator::getFieldNames"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(126): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::getPluginVersion" is incompatible with that of overridden function "nvinfer1::IPluginCreator::getPluginVersion"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.h(124): error: exception specification for virtual function "nvinfer1::YoloPluginCreator::getPluginName" is incompatible with that of overridden function "nvinfer1::IPluginCreator::getPluginName"

/usr/local/include/opencv4/opencv2/stitching/detail/warpers.hpp(235): warning: overloaded virtual function "cv::detail::PlaneWarper::buildMaps" is only partially overridden in class "cv::detail::AffineWarper"

/usr/local/include/opencv4/opencv2/stitching/detail/warpers.hpp(235): warning: overloaded virtual function "cv::detail::PlaneWarper::warp" is only partially overridden in class "cv::detail::AffineWarper"

/usr/local/include/opencv4/opencv2/stitching/detail/blenders.hpp(100): warning: overloaded virtual function "cv::detail::Blender::prepare" is only partially overridden in class "cv::detail::FeatherBlender"

/usr/local/include/opencv4/opencv2/stitching/detail/blenders.hpp(127): warning: overloaded virtual function "cv::detail::Blender::prepare" is only partially overridden in class "cv::detail::MultiBandBlender"

/home/yzc/Projects/tensorrtx/yolov3/yololayer.cu(131): error: object of abstract class type "nvinfer1::YoloLayerPlugin" is not allowed: pure virtual function "nvinfer1::IPluginV2::enqueue" has no overrider

/home/yzc/Projects/tensorrtx/yolov3/yololayer.cu(247): error: object of abstract class type "nvinfer1::YoloLayerPlugin" is not allowed: pure virtual function "nvinfer1::IPluginV2::enqueue" has no overrider

/home/yzc/Projects/tensorrtx/yolov3/yololayer.cu(256): error: object of abstract class type "nvinfer1::YoloLayerPlugin" is not allowed: pure virtual function "nvinfer1::IPluginV2::enqueue" has no overrider

32 errors detected in the compilation of "/home/yzc/Projects/tensorrtx/yolov3/yololayer.cu". CMake Error at yololayer_generated_yololayer.cu.o.Debug.cmake:280 (message): Error generating file /home/yzc/Projects/tensorrtx/yolov3/build/CMakeFiles/yololayer.dir//./yololayer_generated_yololayer.cu.o

make[2]: [CMakeFiles/yololayer.dir/build.make:517: CMakeFiles/yololayer.dir/yololayer_generated_yololayer.cu.o] Error 1 make[1]: [CMakeFiles/Makefile2:104: CMakeFiles/yololayer.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

What's going wrong here? Thanks if anyone can help!

wang-xinyu commented 3 years ago

Currently, only yolov5 and retinaface support trt8.0, you can migrate it yourself referring to yolov5.

YuanZhichao commented 3 years ago

Currently, only yolov5 and retinaface support trt8.0, you can migrate it yourself referring to yolov5.

Thanks! Where should I modify to make yolov3 support trt8? Or, what version of trt is supported for yolov3?

wang-xinyu commented 3 years ago

7.x

You need to check the code, mainly need the macros.h.

YuanZhichao commented 3 years ago

7.x

You need to check the code, mainly need the macros.h.

I'll try it. Thanks!

vjsrinivas commented 2 years ago

@wang-xinyu Are you or anyone else in progress of updating YOLOv3 to TRT8? I went ahead and did it because of an immediate need. I can do a PR as soon as I check if it predicts correctly (only checked if it correctly compiled).

wang-xinyu commented 2 years ago

@vjsrinivas no, you can refer to the yolov5 and make changes accordingly, yolov5 is compatible with both trt8 and trt7.

vjsrinivas commented 2 years ago

@wang-xinyu I've already changed the yolov3 files for TRT8. I was asking if you wanted a PR for that.

wang-xinyu commented 2 years ago

@vjsrinivas yes, please

ritalsq commented 2 years ago

@vjsrinivas hello, could you please share your method with me? I also need this solving way. thanks

vjsrinivas commented 2 years ago

@vjsrinivas hello, could you please share your method with me? I also need this solving way. thanks

Sorry, I got caught up in other work. I'll post a PR tomorrow morning.

ritalsq commented 2 years ago

ok, thanks for your quickly reply! 

---Original--- From: "Vijaysrinivas @.> Date: Sat, Apr 9, 2022 11:10 AM To: @.>; Cc: "attack and @.**@.>; Subject: Re: [wang-xinyu/tensorrtx] Building yolov5 successfully, but makingyolov3/v4 failed. (#705)

@vjsrinivas hello, could you please share your method with me? I also need this solving way. thanks

Sorry, I got caught up in other work. I'll post a PR tomorrow morning.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

vjsrinivas commented 2 years ago

@ritalsq @wang-xinyu pushed PR: https://github.com/wang-xinyu/tensorrtx/pull/967