Closed SlamCabbage closed 2 years ago
你可以尝试不使用全局变量而使用局部变量,将这部分挪到下面的函数中,如图所示
非常感谢您的回复!上述问题已经解决,但是又遇到了新的:
<command-line>: warning: ISO C++11 requires whitespace after the macro name
<command-line>: warning: ISO C++11 requires whitespace after the macro name
<command-line>: warning: ISO C++11 requires whitespace after the macro name
<command-line>: warning: ISO C++11 requires whitespace after the macro name
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp: In member function ‘void rangenet::segmentation::NetTensorRT::serializeEngine(const string&, const string&)’:
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:256:32: error: ‘kPREFER_PRECISION_CONSTRAINTS’ is not a member of ‘nvinfer1::BuilderFlag’
256 | config->setFlag(BuilderFlag::kPREFER_PRECISION_CONSTRAINTS);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:291:16: error: ‘class nvinfer1::IBuilder’ has no member named ‘buildSerializedNetwork’
291 | builder->buildSerializedNetwork(*network, *config));
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::ICudaEngine]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::ICudaEngine; _Dp = std::default_delete<nvinfer1::ICudaEngine>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:100:42: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::ICudaEngine::~ICudaEngine()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:53,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntime.h:1358:13: note: declared protected here
1358 | virtual ~ICudaEngine() {}
| ^
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IExecutionContext]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IExecutionContext; _Dp = std::default_delete<nvinfer1::IExecutionContext>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:101:49: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IExecutionContext::~IExecutionContext()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:53,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntime.h:1693:13: note: declared protected here
1693 | virtual ~IExecutionContext() noexcept {}
| ^
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IRuntime]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IRuntime; _Dp = std::default_delete<nvinfer1::IRuntime>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:226:72: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IRuntime::~IRuntime()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:53,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvInferRuntime.h:801:13: note: declared protected here
801 | virtual ~IRuntime() {}
| ^
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IBuilder]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IBuilder; _Dp = std::default_delete<nvinfer1::IBuilder>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:247:72: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IBuilder::~IBuilder()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvInfer.h:7261:13: note: declared protected here
7261 | virtual ~IBuilder()
| ^
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IBuilderConfig]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IBuilderConfig; _Dp = std::default_delete<nvinfer1::IBuilderConfig>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:253:79: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IBuilderConfig::~IBuilderConfig()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvInfer.h:6756:13: note: declared protected here
6756 | virtual ~IBuilderConfig() {}
| ^
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::INetworkDefinition]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::INetworkDefinition; _Dp = std::default_delete<nvinfer1::INetworkDefinition>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:259:46: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::INetworkDefinition::~INetworkDefinition()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvInfer.h:5434:13: note: declared protected here
5434 | virtual ~INetworkDefinition() {}
| ^
In file included from /usr/include/c++/9/memory:80,
from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11,
from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81,
from /usr/local/include/opencv4/opencv2/core/base.hpp:58,
from /usr/local/include/opencv4/opencv2/core.hpp:54,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13,
from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvonnxparser::IParser]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvonnxparser::IParser; _Dp = std::default_delete<nvonnxparser::IParser>]’
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:264:53: required from here
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvonnxparser::IParser::~IParser()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:12,
from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1:
/usr/include/x86_64-linux-gnu/NvOnnxParser.h:232:13: note: declared protected here
232 | virtual ~IParser() {}
| ^
make[2]: *** [CMakeFiles/rangenet_lib.dir/build.make:76:CMakeFiles/rangenet_lib.dir/src/netTensorRT.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:336:CMakeFiles/rangenet_lib.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
非常感谢您的回复!上述问题已经解决,但是又遇到了新的:
<command-line>: warning: ISO C++11 requires whitespace after the macro name <command-line>: warning: ISO C++11 requires whitespace after the macro name <command-line>: warning: ISO C++11 requires whitespace after the macro name <command-line>: warning: ISO C++11 requires whitespace after the macro name /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp: In member function ‘void rangenet::segmentation::NetTensorRT::serializeEngine(const string&, const string&)’: /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:256:32: error: ‘kPREFER_PRECISION_CONSTRAINTS’ is not a member of ‘nvinfer1::BuilderFlag’ 256 | config->setFlag(BuilderFlag::kPREFER_PRECISION_CONSTRAINTS); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:291:16: error: ‘class nvinfer1::IBuilder’ has no member named ‘buildSerializedNetwork’ 291 | builder->buildSerializedNetwork(*network, *config)); | ^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::ICudaEngine]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::ICudaEngine; _Dp = std::default_delete<nvinfer1::ICudaEngine>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:100:42: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::ICudaEngine::~ICudaEngine()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:53, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvInferRuntime.h:1358:13: note: declared protected here 1358 | virtual ~ICudaEngine() {} | ^ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IExecutionContext]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IExecutionContext; _Dp = std::default_delete<nvinfer1::IExecutionContext>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:101:49: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IExecutionContext::~IExecutionContext()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:53, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvInferRuntime.h:1693:13: note: declared protected here 1693 | virtual ~IExecutionContext() noexcept {} | ^ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IRuntime]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IRuntime; _Dp = std::default_delete<nvinfer1::IRuntime>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:226:72: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IRuntime::~IRuntime()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /usr/include/x86_64-linux-gnu/NvInfer.h:53, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvInferRuntime.h:801:13: note: declared protected here 801 | virtual ~IRuntime() {} | ^ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IBuilder]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IBuilder; _Dp = std::default_delete<nvinfer1::IBuilder>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:247:72: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IBuilder::~IBuilder()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvInfer.h:7261:13: note: declared protected here 7261 | virtual ~IBuilder() | ^ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::IBuilderConfig]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::IBuilderConfig; _Dp = std::default_delete<nvinfer1::IBuilderConfig>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:253:79: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::IBuilderConfig::~IBuilderConfig()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvInfer.h:6756:13: note: declared protected here 6756 | virtual ~IBuilderConfig() {} | ^ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvinfer1::INetworkDefinition]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvinfer1::INetworkDefinition; _Dp = std::default_delete<nvinfer1::INetworkDefinition>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:259:46: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvinfer1::INetworkDefinition::~INetworkDefinition()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:10, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvInfer.h:5434:13: note: declared protected here 5434 | virtual ~INetworkDefinition() {} | ^ In file included from /usr/include/c++/9/memory:80, from /usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:11, from /usr/local/include/opencv4/opencv2/core/cvstd.hpp:81, from /usr/local/include/opencv4/opencv2/core/base.hpp:58, from /usr/local/include/opencv4/opencv2/core.hpp:54, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/net.hpp:13, from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:9, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = nvonnxparser::IParser]’: /usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = nvonnxparser::IParser; _Dp = std::default_delete<nvonnxparser::IParser>]’ /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:264:53: required from here /usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvonnxparser::IParser::~IParser()’ is protected within this context 81 | delete __ptr; | ^~~~~~ In file included from /home/llz/catkin_RNT/src/RangeNetTrt8/include/netTensorRT.hpp:12, from /home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:1: /usr/include/x86_64-linux-gnu/NvOnnxParser.h:232:13: note: declared protected here 232 | virtual ~IParser() {} | ^ make[2]: *** [CMakeFiles/rangenet_lib.dir/build.make:76:CMakeFiles/rangenet_lib.dir/src/netTensorRT.cpp.o] 错误 1 make[1]: *** [CMakeFiles/Makefile2:336:CMakeFiles/rangenet_lib.dir/all] 错误 2 make: *** [Makefile:141:all] 错误 2
我认为其中错误主要在:
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:256:32: error: ‘kPREFER_PRECISION_CONSTRAINTS’ is not a member of ‘nvinfer1::BuilderFlag’
256 | config->setFlag(BuilderFlag::kPREFER_PRECISION_CONSTRAINTS);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/llz/catkin_RNT/src/RangeNetTrt8/src/netTensorRT.cpp:291:16: error: ‘class nvinfer1::IBuilder’ has no member named ‘buildSerializedNetwork’
291 | builder->buildSerializedNetwork(*network, *config));
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/unique_ptr.h:81:2: error: ‘virtual nvonnxparser::IParser::~IParser()’ is protected within this context
81 | delete __ptr;
| ^~~~~~
这两部分在终端中被标红
trt版本需8.2.3+
非常感谢您的回复! 请问您所做的版本在有光追的显卡上效果如何呢
本工程主要是结合学到的cuda等技巧进行加速的,所以重点在于加速上。我是在titan rtx做实验,速度比原来的都要快很多。最新的数据一个是包括前后处理和预测为30ms左右。分割效果上rangenet++什么效果,这个就是什么效果。
您好,我已经更换了我的环境与您的一致。现在也都编译通过了,我想请问我要如何进行测试呢? 就是像rangeNet_lib一样调用infer? 并且在launch文件夹中没有launch文件存在。
非常感谢您的工作,如果可以的话我想添加您的好友,如果您愿意请留下您的邮箱,我联系您。
补充一点:
我使用 ./devel/lib/rangenet_plusplus/infer -h
得到了以下输出
catkin_RNT ./devel/lib/rangenet_plusplus/infer -h
./devel/lib/rangenet_plusplus/infer: error while loading shared libraries: libnvrtc.so.11.1: cannot open shared object file: No such file or directory
我全局搜索之后得到的文件列表
trt版本需8.2.3+
Natsu-Akatsuki 根据用户带来的错误,您是如何理解这一点的?
Just a API migration problem. A more detailed question is welcomed. @Egorundel
感谢您的分享! 我在编译时出现了以下的错误:(我采用的是cuda11.1版本,请问如何在不修改版本的情况下解决这个问题呢?) Errors << rangenet_plusplus:make /home/llz/catkin_RNT/logs/rangenet_plusplus/build.make.000.log