当前位置:网站首页>错误 C2694 “void Logger::log(nvinfer1::ILogger::Severity,const char *)”: 重写虚函数的限制性异常规范比基类虚成员函数
错误 C2694 “void Logger::log(nvinfer1::ILogger::Severity,const char *)”: 重写虚函数的限制性异常规范比基类虚成员函数
2022-07-03 03:38:00 【AI视觉网奇】
tensorrt c++报错:
错误 C2694 “void Logger::log(nvinfer1::ILogger::Severity,const char *)”: 重写虚函数的限制性异常规范比基类虚成员函数
问题:“Looser throw specifier for ‘xxxxxxxxxx’”
例子:
looser throw specifier for ‘virtual void Logger::log(nvinfer1::ILogger::Severity, const char*)’
解决:参考链接
在函数中加入noexcept
因为,在tensorrt8.0版本中函数的定义是:
void Logger::log(Severity severity, const char* msg) noexcept
所以自己的报错的函数对应也改为:
virtual void log(Severity severity, const char* msg) noexcept override;我的修改后的代码:
void log(Severity severity, const char* msg) noexcept override
{
LogStreamConsumer(mReportableSeverity, severity) << "[TRT] " << std::string(msg) << std::endl;
}
其他报错Looser throw specifier的同样解决方法,增加noexcept。
问题2:nvinfer plugin调用
参考链接:https://blog.csdn.net/XCCCCZ/article/details/121301106
报错如下:yololayer.h(54): 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?
yololayer.cu(156): error: object of abstract class type “nvinfer1::YoloLayerPlugin” is not allowed:
pure virtual function “nvinfer1::IPluginV2::enqueue” has no overrider
yololayer.cu(299): error: object of abstract class type “nvinfer1::YoloLayerPlugin” is not allowed:
pure virtual function “nvinfer1::IPluginV2::enqueue” has no overrider
yololayer.cu(308): error: object of abstract class type “nvinfer1::YoloLayerPlugin” is not allowed:
pure virtual function “nvinfer1::IPluginV2::enqueue” has no overrider
解决方法:将virtual int enqueue(int batchSize, const voidconst * inputs, void** outputs, void workspace, cudaStream_t stream) override;改成virtual int32_t enqueue(int32_t batchSize, void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept;
————————————————
版权声明:本文为CSDN博主「云秋水慢」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yunqiushuiman/article/details/125477748
这篇讲的差不多:
边栏推荐
- 为什么线程崩溃不会导致 JVM 崩溃
- ffmpeg录制屏幕和截屏
- PHP generates PDF tcpdf
- float与0比较
- [MySQL] the difference between left join, right join and join
- Advanced redis applications [password protection, data persistence, master-slave synchronization, sentinel mode, transactions] [not completed yet (semi-finished products)]
- Pat class B "1104 forever" DFS optimization idea
- 监听对象中值变化及访问
- ffmpeg下载安装教程及介绍
- LVGL使用心得
猜你喜欢

softmax的近似之NCE详解

为什么线程崩溃不会导致 JVM 崩溃

Some preliminary preparations for QQ applet development: make an appointment for a development account, download and install developer tools, and create QQ applet

NPM: the 'NPM' item cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Please check the spelling of the name. If the path is included, make sure the path is corr

MongoDB简介

TCP/IP模型中的重磅嘉宾TCP--尚文网络奎哥

Limit of one question per day

The calculation of stripe, kernel and padding in CNN

机械臂速成小指南(八):运动学建模(标准DH法)

Ansible简介【暂未完成(半成品)】
随机推荐
Introduction à mongodb
Why does thread crash not cause JVM crash
Message queue addition failure
Nce detail of softmax approximation
渤、黄海的潮汐特征
PHP generates PDF tcpdf
Lvgl usage experience
File rename
[set theory] partial order relation (partial order relation definition | partial order set definition | greater than or equal to relation | less than or equal to relation | integer division relation |
Hutool动态添加定时任务
Téléchargement et installation du client Filezilla
Mongodb master profile
Pytoch lightweight visualization tool wandb (local)
Convert binary stream to byte array
Limit of one question per day
js中#号的作用
二进制流转换成字节数组
com. fasterxml. jackson. databind. Exc.invalidformatexception problem
Nanning water leakage detection: warmly congratulate Guangxi Zhongshui on winning the first famous brand in Guangxi
Basic operations of mongodb [add, delete, modify, query]