Failed to build jetbot via CMake - error: looser throw specifier for ‘virtual int FlattenConcat::getNbOutputs() const’ int getNbOutputs() const override
jiapei100 opened this issue · 4 comments
[ 50%] Building CXX object jetbot/ssd_tensorrt/CMakeFiles/ssd_tensorrt.dir/FlattenConcat.cpp.o
cd....../build/jetbot/ssd_tensorrt && /usr/bin/c++ -Dssd_tensorrt_EXPORTS -I/usr/local/cuda/include -O3 -DNDEBUG -fPIC -o CMakeFiles/ssd_tensorrt.dir/FlattenConcat.cpp.o -c....../jetbot/ssd_tensorrt/FlattenConcat.cpp
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:63:9: error: looser throw specifier for ‘virtual int FlattenConcat::getNbOutputs() const’
int getNbOutputs() const override
^~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:469:21: error: overriding ‘virtual int32_t nvinfer1::IPluginV2::getNbOutputs() const noexcept’
virtual int32_t getNbOutputs() const noexcept = 0;
^~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:69:10: error: looser throw specifier for ‘virtual nvinfer1::Dims FlattenConcat::getOutputDimensions(int, const Dims*, int)’
Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) override
^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:486:18: error: overriding ‘virtual nvinfer1::Dims nvinfer1::IPluginV2::getOutputDimensions(int32_t, const Dims*, int32_t) noexcept’
virtual Dims getOutputDimensions(int32_t index, Dims const* inputs, int32_t nbInputDims) noexcept = 0;
^~~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:92:9: error: looser throw specifier for ‘virtual int FlattenConcat::initialize()’
int initialize() override
^~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:558:21: error: overriding ‘virtual int32_t nvinfer1::IPluginV2::initialize() noexcept’
virtual int32_t initialize() noexcept = 0;
^~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:100:10: error: looser throw specifier for ‘virtual void FlattenConcat::terminate()’
void terminate() override
^~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:572:18: error: overriding ‘virtual void nvinfer1::IPluginV2::terminate() noexcept’
virtual void terminate() noexcept = 0;
^~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:107:12: error: looser throw specifier for ‘virtual size_t FlattenConcat::getWorkspaceSize(int) const’
size_t getWorkspaceSize(int maxBatchSize) const override
^~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:588:20: error: overriding ‘virtual size_t nvinfer1::IPluginV2::getWorkspaceSize(int32_t) const noexcept’
virtual size_t getWorkspaceSize(int32_t maxBatchSize) const noexcept = 0;
^~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:113:9: error: ‘int FlattenConcat::enqueue(int, const void* const*, void**, void*, cudaStream_t)’ marked ‘override’, but does not override
int enqueue(int batchSize, const void* const* inputs, void** outputs, void*, cudaStream_t stream) override
^~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:135:12: error: looser throw specifier for ‘virtual size_t FlattenConcat::getSerializationSize() const’
size_t getSerializationSize() const override
^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:620:20: error: overriding ‘virtual size_t nvinfer1::IPluginV2::getSerializationSize() const noexcept’
virtual size_t getSerializationSize() const noexcept = 0;
^~~~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:144:10: error: looser throw specifier for ‘virtual void FlattenConcat::serialize(void*) const’
void serialize(void* buffer) const override
^~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:635:18: error: overriding ‘virtual void nvinfer1::IPluginV2::serialize(void*) const noexcept’
virtual void serialize(void* buffer) const noexcept = 0;
^~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:168:10: error: looser throw specifier for ‘virtual void FlattenConcat::configureWithFormat(const Dims*, int, const Dims*, int, nvinfer1::DataType, nvinfer1::PluginFormat, int)’
void configureWithFormat(const Dims* inputs, int nbInputs, const Dims* outputDims, int nbOutputs, nvinfer1::DataType type, nvinfer1::PluginFormat format, int maxBatchSize) override
^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:543:18: error: overriding ‘virtual void nvinfer1::IPluginV2::configureWithFormat(const Dims*, int32_t, const Dims*, int32_t, nvinfer1::DataType, nvinfer1::PluginFormat, int32_t) noexcept’
virtual void configureWithFormat(Dims const* inputDims, int32_t nbInputs, Dims const* outputDims, int32_t nbOutputs,
^~~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:198:10: error: looser throw specifier for ‘virtual bool FlattenConcat::supportsFormat(nvinfer1::DataType, nvinfer1::PluginFormat) const’
bool supportsFormat(DataType type, PluginFormat format) const override
^~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:510:18: error: overriding ‘virtual bool nvinfer1::IPluginV2::supportsFormat(nvinfer1::DataType, nvinfer1::PluginFormat) const noexcept’
virtual bool supportsFormat(DataType type, PluginFormat format) const noexcept = 0;
^~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:203:17: error: looser throw specifier for ‘virtual const char* FlattenConcat::getPluginType() const’
const char* getPluginType() const override { return FLATTENCONCAT_PLUGIN_NAME; }
^~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:440:30: error: overriding ‘virtual const AsciiChar* nvinfer1::IPluginV2::getPluginType() const noexcept’
virtual AsciiChar const* getPluginType() const noexcept = 0;
^~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:205:17: error: looser throw specifier for ‘virtual const char* FlattenConcat::getPluginVersion() const’
const char* getPluginVersion() const override { return FLATTENCONCAT_PLUGIN_VERSION; }
^~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:454:30: error: overriding ‘virtual const AsciiChar* nvinfer1::IPluginV2::getPluginVersion() const noexcept’
virtual AsciiChar const* getPluginVersion() const noexcept = 0;
^~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:207:10: error: looser throw specifier for ‘virtual void FlattenConcat::destroy()’
void destroy() override {}
^~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:645:18: error: overriding ‘virtual void nvinfer1::IPluginV2::destroy() noexcept’
virtual void destroy() noexcept = 0;
^~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:209:16: error: looser throw specifier for ‘virtual nvinfer1::IPluginV2* FlattenConcat::clone() const’
IPluginV2* clone() const override
^~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:661:24: error: overriding ‘virtual nvinfer1::IPluginV2* nvinfer1::IPluginV2::clone() const noexcept’
virtual IPluginV2* clone() const noexcept = 0;
^~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:214:10: error: looser throw specifier for ‘virtual void FlattenConcat::setPluginNamespace(const char*)’
void setPluginNamespace(const char* pluginNamespace) override
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:677:18: error: overriding ‘virtual void nvinfer1::IPluginV2::setPluginNamespace(const AsciiChar*) noexcept’
virtual void setPluginNamespace(AsciiChar const* pluginNamespace) noexcept = 0;
^~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:219:17: error: looser throw specifier for ‘virtual const char* FlattenConcat::getPluginNamespace() const’
const char* getPluginNamespace() const override
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:687:30: error: overriding ‘virtual const AsciiChar* nvinfer1::IPluginV2::getPluginNamespace() const noexcept’
virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
^~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp: In member function ‘virtual nvinfer1::Dims FlattenConcat::getOutputDimensions(int, const Dims*, int)’:
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:89:16: error: ‘DimsCHW’ was not declared in this scope
return DimsCHW(flattenedOutputSize, 1, 1);
^~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp: In member function ‘virtual bool FlattenConcat::supportsFormat(nvinfer1::DataType, nvinfer1::PluginFormat) const’:
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:200:69: error: ‘kNCHW’ is not a member of ‘nvinfer1::PluginFormat {aka nvinfer1::TensorFormat}’
return (type == DataType::kFLOAT && format == PluginFormat::kNCHW);
^~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp: In member function ‘virtual nvinfer1::IPluginV2* FlattenConcat::clone() const’:
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:211:110: error: invalid new-expression of abstract class type ‘FlattenConcat’
return new FlattenConcat(mFlattenedInputSize.data(), mFlattenedInputSize.size(), mFlattenedOutputSize);
^
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:33:7: note: because the following virtual functions are pure within ‘FlattenConcat’:
class FlattenConcat : public IPluginV2
^~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:606:21: note: virtual int32_t nvinfer1::IPluginV2::enqueue(int32_t, const void* const*, void* const*, void*, cudaStream_t)
virtual int32_t enqueue(int32_t batchSize, void const* const* inputs, void* const* outputs, void* workspace,
^~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp: At global scope:
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:263:17: error: looser throw specifier for ‘virtual const char* FlattenConcatPluginCreator::getPluginName() const’
const char* getPluginName() const override { return FLATTENCONCAT_PLUGIN_NAME; }
^~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1134:30: error: overriding ‘virtual const AsciiChar* nvinfer1::IPluginCreator::getPluginName() const noexcept’
virtual AsciiChar const* getPluginName() const noexcept = 0;
^~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:265:17: error: looser throw specifier for ‘virtual const char* FlattenConcatPluginCreator::getPluginVersion() const’
const char* getPluginVersion() const override { return FLATTENCONCAT_PLUGIN_VERSION; }
^~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1148:30: error: overriding ‘virtual const AsciiChar* nvinfer1::IPluginCreator::getPluginVersion() const noexcept’
virtual AsciiChar const* getPluginVersion() const noexcept = 0;
^~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:267:34: error: looser throw specifier for ‘virtual const nvinfer1::PluginFieldCollection* FlattenConcatPluginCreator::getFieldNames()’
const PluginFieldCollection* getFieldNames() override { return &mFC; }
^~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1160:42: error: overriding ‘virtual const nvinfer1::PluginFieldCollection* nvinfer1::IPluginCreator::getFieldNames() noexcept’
virtual PluginFieldCollection const* getFieldNames() noexcept = 0;
^~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:269:16: error: looser throw specifier for ‘virtual nvinfer1::IPluginV2* FlattenConcatPluginCreator::createPlugin(const char*, const nvinfer1::PluginFieldCollection*)’
IPluginV2* createPlugin(const char* name, const PluginFieldCollection* fc) override
^~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1171:24: error: overriding ‘virtual nvinfer1::IPluginV2* nvinfer1::IPluginCreator::createPlugin(const AsciiChar*, const nvinfer1::PluginFieldCollection*) noexcept’
virtual IPluginV2* createPlugin(AsciiChar const* name, PluginFieldCollection const* fc) noexcept = 0;
^~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:274:16: error: looser throw specifier for ‘virtual nvinfer1::IPluginV2* FlattenConcatPluginCreator::deserializePlugin(const char*, const void*, size_t)’
IPluginV2* deserializePlugin(const char* name, const void* serialData, size_t serialLength) override
^~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1182:24: error: overriding ‘virtual nvinfer1::IPluginV2* nvinfer1::IPluginCreator::deserializePlugin(const AsciiChar*, const void*, size_t) noexcept’
virtual IPluginV2* deserializePlugin(AsciiChar const* name, void const* serialData, size_t serialLength) noexcept
^~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:280:10: error: looser throw specifier for ‘virtual void FlattenConcatPluginCreator::setPluginNamespace(const char*)’
void setPluginNamespace(const char* pluginNamespace) override
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1197:18: error: overriding ‘virtual void nvinfer1::IPluginCreator::setPluginNamespace(const AsciiChar*) noexcept’
virtual void setPluginNamespace(AsciiChar const* pluginNamespace) noexcept = 0;
^~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:285:17: error: looser throw specifier for ‘virtual const char* FlattenConcatPluginCreator::getPluginNamespace() const’
const char* getPluginNamespace() const override
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/aarch64-linux-gnu/NvInferLegacyDims.h:53:0,
from /usr/include/aarch64-linux-gnu/NvInfer.h:53,
from /usr/include/aarch64-linux-gnu/NvInferPlugin.h:53,
from....../jetbot/ssd_tensorrt/FlattenConcat.cpp:9:
/usr/include/aarch64-linux-gnu/NvInferRuntimeCommon.h:1211:30: error: overriding ‘virtual const AsciiChar* nvinfer1::IPluginCreator::getPluginNamespace() const noexcept’
virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
^~~~~~~~~~~~~~~~~~
....../jetbot/ssd_tensorrt/FlattenConcat.cpp: In member function ‘virtual nvinfer1::IPluginV2* FlattenConcatPluginCreator::createPlugin(const char*, const nvinfer1::PluginFieldCollection*)’:
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:271:34: error: invalid new-expression of abstract class type ‘FlattenConcat’
return new FlattenConcat();
^
....../jetbot/ssd_tensorrt/FlattenConcat.cpp: In member function ‘virtual nvinfer1::IPluginV2* FlattenConcatPluginCreator::deserializePlugin(const char*, const void*, size_t)’:
....../jetbot/ssd_tensorrt/FlattenConcat.cpp:277:58: error: invalid new-expression of abstract class type ‘FlattenConcat’
return new FlattenConcat(serialData, serialLength);
^
jetbot/ssd_tensorrt/CMakeFiles/ssd_tensorrt.dir/build.make:65: recipe for target 'jetbot/ssd_tensorrt/CMakeFiles/ssd_tensorrt.dir/FlattenConcat.cpp.o' failed
make[2]: *** [jetbot/ssd_tensorrt/CMakeFiles/ssd_tensorrt.dir/FlattenConcat.cpp.o] Error 1
make[2]: Leaving directory '....../build'
CMakeFiles/Makefile2:106: recipe for target 'jetbot/ssd_tensorrt/CMakeFiles/ssd_tensorrt.dir/all' failed
make[1]: *** [jetbot/ssd_tensorrt/CMakeFiles/ssd_tensorrt.dir/all] Error 2
make[1]: Leaving directory '....../build'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2
➜ build git:(master) ✗
解决了吗
@lanhong123 嗯嗯... 我直接略过了...
视频在这里 https://www.youtube.com/watch?v=NQCs-tEwwWE
总之就是:
- 放弃编译 jetbot
- 直接安装jetpack
- 要找到相应的版本,我的是jetson nano,而不是jetsson orin nano,所以jetpack版本一定要找正确了
- 我最想用的好像是jetcam??
有点忘记了...总之搞了近1个星期...
谢谢你的的回答,我刚才找到了原因,我用的是jetsonnao的JetsonNanoUb20_3b.img镜像,想手动添加jetbot库,出现了以上问题,发现是jetbot/ssd_tensorrt/FlattenConcat.cpp里面的一些版本不适配问题导致的,根据问题一条条修改,最后成功安装并运行了Jetbot,修改后的/FlattenConcat.cpp如下:
#include
#include
#include
#include
#include
#include <cublas_v2.h>
#include "NvInfer.h"
#include "NvInferPlugin.h"
#define CHECK(status)
do
{
auto ret = (status);
if (ret != 0)
{
std::cout << "Cuda failure: " << ret;
abort();
}
} while (0)
using namespace nvinfer1;
namespace
{
const char* FLATTENCONCAT_PLUGIN_VERSION{"1"};
const char* FLATTENCONCAT_PLUGIN_NAME{"FlattenConcat_TRT_jetbot"};
}
class FlattenConcat : public IPluginV2
{
public:
FlattenConcat() {}
FlattenConcat(const int* flattenedInputSize, int numInputs, int flattenedOutputSize)
: mFlattenedOutputSize(flattenedOutputSize)
{
for (int i = 0; i < numInputs; ++i)
mFlattenedInputSize.push_back(flattenedInputSize[i]);
}
FlattenConcat(const void* data, size_t length)
{
const char* d = reinterpret_cast<const char*>(data);
const char* a = d;
size_t numInputs = read<size_t>(d);
for (size_t i = 0; i < numInputs; ++i)
{
mFlattenedInputSize.push_back(read<int>(d));
}
mFlattenedOutputSize = read<int>(d);
assert(d == a + length);
}
int32_t getNbOutputs() const noexcept override
{
return 1;
}
Dims getOutputDimensions(int32_t index, const Dims* inputs, int32_t nbInputDims) noexcept override
{
assert(nbInputDims >= 1);
assert(index == 0);
size_t flattenedOutputSize = 0;
int32_t inputVolume = 0;
for (int32_t i = 0; i < nbInputDims; ++i)
{
assert(inputs[i].nbDims == 3);
inputVolume = inputs[i].d[0] * inputs[i].d[1] * inputs[i].d[2];
flattenedOutputSize += inputVolume;
}
Dims dims;
dims.nbDims = 3;
dims.d[0] = flattenedOutputSize;
dims.d[1] = 1;
dims.d[2] = 1;
return dims;
}
int32_t initialize() noexcept override
{
CHECK(cublasCreate(&mCublas));
return 0;
}
void terminate() noexcept override
{
CHECK(cublasDestroy(mCublas));
}
size_t getWorkspaceSize(int32_t maxBatchSize) const noexcept override
{
return 0;
}
int32_t enqueue(int32_t batchSize, const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept override
{
size_t inputOffset = 0;
float* output = reinterpret_cast<float*>(outputs[0]);
for (size_t i = 0; i < mFlattenedInputSize.size(); ++i)
{
const float* input = reinterpret_cast<const float*>(inputs[i]);
for (int32_t batchIdx = 0; batchIdx < batchSize; ++batchIdx)
{
CHECK(cublasScopy(mCublas, mFlattenedInputSize[i],
input + batchIdx * mFlattenedInputSize[i], 1,
output + (batchIdx * mFlattenedOutputSize + inputOffset), 1));
}
inputOffset += mFlattenedInputSize[i];
}
return 0;
}
size_t getSerializationSize() const noexcept override
{
size_t size = sizeof(mFlattenedInputSize[0]) * mFlattenedInputSize.size()
+ sizeof(mFlattenedOutputSize)
+ sizeof(size_t);
return size;
}
void serialize(void* buffer) const noexcept override
{
char* d = reinterpret_cast<char*>(buffer);
char* a = d;
size_t numInputs = mFlattenedInputSize.size();
write(d, numInputs);
for (size_t i = 0; i < numInputs; ++i)
{
write(d, mFlattenedInputSize[i]);
}
write(d, mFlattenedOutputSize);
assert(d == a + getSerializationSize());
}
void configureWithFormat(const Dims* inputs, int32_t nbInputs, const Dims* outputDims, int32_t nbOutputs, DataType type, PluginFormat format, int32_t maxBatchSize) noexcept override
{
assert(nbOutputs == 1);
mFlattenedInputSize.clear();
mFlattenedOutputSize = 0;
for (int32_t i = 0; i < nbInputs; ++i)
{
int32_t inputVolume = 0;
assert(inputs[i].nbDims == 3);
for (size_t dim = 1; dim < 3; dim++)
{
assert(inputs[i].d[dim] == inputs[0].d[dim]);
}
inputVolume = inputs[i].d[0] * inputs[i].d[1] * inputs[i].d[2];
mFlattenedInputSize.push_back(inputVolume);
mFlattenedOutputSize += mFlattenedInputSize[i];
}
}
bool supportsFormat(DataType type, PluginFormat format) const noexcept override
{
return (type == DataType::kFLOAT);
}
const char* getPluginType() const noexcept override { return FLATTENCONCAT_PLUGIN_NAME; }
const char* getPluginVersion() const noexcept override { return FLATTENCONCAT_PLUGIN_VERSION; }
void destroy() noexcept override {}
IPluginV2* clone() const noexcept override
{
return new FlattenConcat(mFlattenedInputSize.data(), static_cast<int>(mFlattenedInputSize.size()), mFlattenedOutputSize);
}
void setPluginNamespace(const char* pluginNamespace) noexcept override
{
mPluginNamespace = pluginNamespace;
}
const char* getPluginNamespace() const noexcept override
{
return mPluginNamespace.c_str();
}
private:
template
void write(char*& buffer, const T& val) const noexcept
{
reinterpret_cast<T>(buffer) = val;
buffer += sizeof(T);
}
template <typename T>
T read(const char*& buffer) noexcept
{
T val = *reinterpret_cast<const T*>(buffer);
buffer += sizeof(T);
return val;
}
std::vector<int32_t> mFlattenedInputSize;
int32_t mFlattenedOutputSize{0};
cublasHandle_t mCublas;
std::string mPluginNamespace = "";
};
class FlattenConcatPluginCreator : public IPluginCreator
{
public:
FlattenConcatPluginCreator()
{
mFC.nbFields = 0;
mFC.fields = 0;
}
~FlattenConcatPluginCreator() {}
const char* getPluginName() const noexcept override { return FLATTENCONCAT_PLUGIN_NAME; }
const char* getPluginVersion() const noexcept override { return FLATTENCONCAT_PLUGIN_VERSION; }
const PluginFieldCollection* getFieldNames() noexcept override { return &mFC; }
IPluginV2* createPlugin(const char* name, const PluginFieldCollection* fc) noexcept override
{
return new FlattenConcat();
}
IPluginV2* deserializePlugin(const char* name, const void* serialData, size_t serialLength) noexcept override
{
return new FlattenConcat(serialData, serialLength);
}
void setPluginNamespace(const char* pluginNamespace) noexcept override
{
mPluginNamespace = pluginNamespace;
}
const char* getPluginNamespace() const noexcept override
{
return mPluginNamespace.c_str();
}
private:
static PluginFieldCollection mFC;
std::string mPluginNamespace = "";
};
PluginFieldCollection FlattenConcatPluginCreator::mFC{};
REGISTER_TENSORRT_PLUGIN(FlattenConcatPluginCreator);