当前位置:网站首页>错误 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
这篇讲的差不多:
边栏推荐
- Pat class B common function Usage Summary
- Pytoch configuration
- Compare float with 0
- Vs 2019 installation and configuration opencv
- Applet (continuous update)
- Ffmpeg download and installation tutorial and introduction
- float与0比较
- 递归:深度优先搜索
- Bigvision code
- Summary of determinant knowledge points in Chapter 1 of Linear Algebra (Jeff's self perception)
猜你喜欢
900w+ data, from 17s to 300ms, how to operate
Pytoch lightweight visualization tool wandb (local)
Mongodb installation & Deployment
Lvgl usage experience
Ansible简介【暂未完成(半成品)】
Hutool动态添加定时任务
Makefile demo
ffmpeg录制屏幕和截屏
Nanning water leakage detection: warmly congratulate Guangxi Zhongshui on winning the first famous brand in Guangxi
Summary of electromagnetic spectrum
随机推荐
Mysql Mac版下载安装教程
释放数据力量的Ceph-尚文网络xUP楠哥
[mathematical logic] propositional logic (propositional logic reasoning | formal structure of reasoning | inference law | additional law | simplification law | hypothetical reasoning | refusal | disju
解决高並發下System.currentTimeMillis卡頓
Pat class B "1104 forever" DFS optimization idea
【全民编程】《软件编程-讲课视频》【零基础入门到实战应用】
Section 26 detailed explanation and demonstration of IPSec virtual private network configuration experiment - simulation experiment based on packettracer8.0
使用InputFilter限制EditText时踩坑及解决方案
MongoDB简介
redis高级应用【密码防护、数据持久化、主从同步、哨兵模式、事务】【暂未完成(半成品)】
ffmpeg下载安装教程及介绍
Ffmpeg recording screen and screenshot
The difference between static web pages and dynamic web pages & the difference between Web1.0 and Web2.0 & the difference between get and post
@Accessors annotation function specifies that the prefix follows the hump naming
[embedded module] OLED display module
Elsevier latex 提交文章 pdftex.def Error: File `thumbnails/cas-email.jpeg‘ not found: using draf
Solve high and send system Currenttimemillis Caton
Latest version of NPM: the "NPM" item cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Please check
The file marked by labelme is converted to yolov5 format
Nce detail of softmax approximation