当前位置:网站首页>错误 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
这篇讲的差不多:
边栏推荐
- Summary of determinant knowledge points in Chapter 1 of Linear Algebra (Jeff's self perception)
- Makefile demo
- softmax的近似之NCE详解
- 如何迈向IPv6之IPv6过渡技术-尚文网络奎哥
- 小程序获取用户头像和昵称
- 简易版 微信小程序开发之for指令、上传图片及展示效果优化
- 递归使用和多维数组对象变一维数组对象
- Dynamic programming: longest common substring and longest common subsequence
- Hi3536C V100R001C02SPC040 交叉编译器安装
- 用Three.js做一個簡單的3D場景
猜你喜欢

ffmpeg录制屏幕和截屏

leetcode:动态规划模板

编译文件时报错:错误: 编码GBK的不可映射字符

FileZilla Client下載安裝

Captura下载安装及在Captura配置FFmpeg

Mysql Mac版下载安装教程

Limit of one question per day

Why does thread crash not cause JVM crash

Latest version of NPM: the "NPM" item cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Please check

Vs 2019 configuration tensorrt
随机推荐
为什么线程崩溃不会导致 JVM 崩溃
Solve high and send system Currenttimemillis Caton
VS克隆时显示403错误
静态网页 和 动态网页的区别 & WEB1.0和WEB2.0的区别 & GET 和 POST 的区别
Pytorch轻量级可视化工具wandb(local)
编译文件时报错:错误: 编码GBK的不可映射字符
MongoDB簡介
[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 |
Tidal characteristics of the Bohai Sea and the Yellow Sea
Introduction to mongodb
403 error displayed when vs cloning
On the adjacency matrix and adjacency table of graph storage
npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
File rename
Section 26 detailed explanation and demonstration of IPSec virtual private network configuration experiment - simulation experiment based on packettracer8.0
Pytoch configuration
Lvgl usage experience
softmax的近似之NCE详解
Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop
2020-01-01t00:00:00.000000z date format conversion