当前位置:网站首页>错误 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
这篇讲的差不多:
边栏推荐
- Lvgl usage experience
- 渤、黄海的潮汐特征
- Bigvision code
- Web会话管理安全问题
- [algebraic structure] group (definition of group | basic properties of group | proof method of group | commutative group)
- Summary of electromagnetic spectrum
- softmax的近似之NCE详解
- Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop
- 监听对象中值变化及访问
- LVGL使用心得
猜你喜欢

如何迈向IPv6之IPv6过渡技术-尚文网络奎哥

递归:深度优先搜索

MySQL MAC download and installation tutorial
![Ansible introduction [unfinished (semi-finished products)]](/img/2a/0003daf761ba02d8837c4657fc3f29.png)
Ansible introduction [unfinished (semi-finished products)]

ffmpeg下载安装教程及介绍

The series of hyperbolic function in daily problem

Hutool dynamically adds scheduled tasks
![Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence](/img/60/bae0e8d92a53bcd2b2de3fb22b3b99.jpg)
Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence

用Three.js做一个简单的3D场景

为什么线程崩溃不会导致 JVM 崩溃
随机推荐
[mathematical logic] propositional logic (propositional logic reasoning | formal structure of reasoning | inference law | additional law | simplification law | hypothetical reasoning | refusal | disju
Null and undefined
IPv6过渡技术-6to4手工隧道配置实验--尚文网络奎哥
Stepping on pits and solutions when using inputfilter to limit EditText
[pyg] understand the messagepassing process, GCN demo details
Pytoch lightweight visualization tool wandb (local)
Bigvision code
New programmers use the isXXX form to define Boolean types in the morning, and are discouraged in the afternoon?
Leetcode: dynamic planning template
Pat class B common function Usage Summary
Introduction to mongodb
Pat class B "1104 forever" DFS optimization idea
Filter
Limit of one question per day
The XML file generated by labelimg is converted to VOC format
解决高並發下System.currentTimeMillis卡頓
递归:深度优先搜索
Basic operations of mongodb [add, delete, modify, query]
用Three.js做一个简单的3D场景
Change and access of median value of listening object