linghu8812 / tensorrt_inference

697 stars 205 forks source link

make -j error #88

Open JobCollins opened 3 years ago

JobCollins commented 3 years ago

Running make -j gives the following output and error:

[ 33%] Building CXX object CMakeFiles/ScaledYOLOv4_trt.dir/ScaledYOLOv4.cpp.o
In file included from /content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:9:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/logging.h:239:10: error: looser throw specifier for ‘virtual void Logger::log(nvinfer1::ILogger::Severity, const char*)’
     void log(Severity severity, const char* msg) override
          ^~~
In file included from /usr/include/x86_64-linux-gnu/NvInferLegacyDims.h:53:0,
                 from /usr/include/x86_64-linux-gnu/NvInfer.h:53,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntimeCommon.h:1203:18: error:   overriding ‘virtual void nvinfer1::ILogger::log(nvinfer1::ILogger::Severity, const AsciiChar*) noexcept’
     virtual void log(Severity severity, AsciiChar const* msg) noexcept = 0;
                  ^~~
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:0:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp: In function ‘bool readTrtFile(const string&, nvinfer1::ICudaEngine*&)’:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:108:99: warning: ‘nvinfer1::ICudaEngine* nvinfer1::IRuntime::deserializeCudaEngine(const void*, std::size_t, nvinfer1::IPluginFactory*)’ is deprecated [-Wdeprecated-declarations]
     engine = trtRuntime->deserializeCudaEngine(cached_engine.data(), cached_engine.size(), nullptr);
                                                                                                   ^
In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:54:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntime.h:661:43: note: declared here
     TRT_DEPRECATED nvinfer1::ICudaEngine* deserializeCudaEngine(
                                           ^~~~~~~~~~~~~~~~~~~~~
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:0:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp: In function ‘void onnxToTRTModel(const string&, const string&, nvinfer1::ICudaEngine*&, const int&)’:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:136:62: warning: ‘nvinfer1::ICudaEngine* nvinfer1::IBuilder::buildEngineWithConfig(nvinfer1::INetworkDefinition&, nvinfer1::IBuilderConfig&)’ is deprecated [-Wdeprecated-declarations]
     engine = builder->buildEngineWithConfig(*network, *config);
                                                              ^
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInfer.h:7968:43: note: declared here
     TRT_DEPRECATED nvinfer1::ICudaEngine* buildEngineWithConfig(
                                           ^~~~~~~~~~~~~~~~~~~~~
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:0:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:140:21: warning: ‘virtual void nvonnxparser::IParser::destroy()’ is deprecated [-Wdeprecated-declarations]
     parser->destroy();
                     ^
In file included from /content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:8:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:
/usr/include/x86_64-linux-gnu/NvOnnxParser.h:197:33: note: declared here
     TRT_DEPRECATED virtual void destroy() = 0;
                                 ^~~~~~~
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:0:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:150:22: warning: ‘void nvinfer1::INetworkDefinition::destroy()’ is deprecated [-Wdeprecated-declarations]
     network->destroy();
                      ^
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInfer.h:5841:25: note: declared here
     TRT_DEPRECATED void destroy() noexcept
                         ^~~~~~~
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:3:0:
/content/tensorrt_inference/ScaledYOLOv4/../includes/common/common.hpp:151:22: warning: ‘void nvinfer1::IBuilder::destroy()’ is deprecated [-Wdeprecated-declarations]
     builder->destroy();
                      ^
In file included from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInfer.h:7907:25: note: declared here
     TRT_DEPRECATED void destroy() noexcept
                         ^~~~~~~
/content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp: In member function ‘bool ScaledYOLOv4::InferenceFolder(const string&)’:
/content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:92:22: warning: ‘void nvinfer1::IExecutionContext::destroy()’ is deprecated [-Wdeprecated-declarations]
     context->destroy();
                      ^
In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:54:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntime.h:1861:25: note: declared here
     TRT_DEPRECATED void destroy() noexcept
                         ^~~~~~~
/content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:93:21: warning: ‘void nvinfer1::ICudaEngine::destroy()’ is deprecated [-Wdeprecated-declarations]
     engine->destroy();
                     ^
In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:54:0,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.h:5,
                 from /content/tensorrt_inference/ScaledYOLOv4/ScaledYOLOv4.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntime.h:1407:25: note: declared here
     TRT_DEPRECATED void destroy() noexcept
                         ^~~~~~~
CMakeFiles/ScaledYOLOv4_trt.dir/build.make:75: recipe for target 'CMakeFiles/ScaledYOLOv4_trt.dir/ScaledYOLOv4.cpp.o' failed
make[2]: *** [CMakeFiles/ScaledYOLOv4_trt.dir/ScaledYOLOv4.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/ScaledYOLOv4_trt.dir/all' failed
make[1]: *** [CMakeFiles/ScaledYOLOv4_trt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Here is the environment details (Colab):

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0
Ubuntu 18.04.5 LTS \n \l

2.4.1

How can I make it work?

Wooks-git commented 2 years ago

Hi, did you fix your error? i have same error with you

chapmanethan commented 2 years ago

I had the same issue, was able to solve it by adding noexcept to line 239 in includes/common/logging.h

void log(Severity severity, const char* msg) override

Add noexcept

void log(Severity severity, const char* msg) noexcept override

More details here: https://forums.developer.nvidia.com/t/looser-throw-specifier-for-virtual-void-logger-log/187963/6