Ubuntu20 安装 带cuda的opencv遇到的问题

问题1:

CUDA 12.2 fp16 dnn 编译错误 错误 C2666: 'operator !=': 具有类似的转换重载函数

解决:

CUDA 12.2 fp16 dnn compilation error · Issue #23893 · opencv/opencv · GitHub

Solution:

I "solved" this by using static_cast.

You want to change line 114 in opencv/modules/dnn/src/cuda4dnn/primitives/normalize_bbox.hpp:

from:
if (weight != 1.0)

to:
if (weight != static_cast<T>(1.0))

As well as line 124 in opencv/modules/dnn/src/cuda4dnn/primitives/region.hpp (due to a similar error):

from:
if (nms_iou_threshold > 0) {

to:
if (nms_iou_threshold > static_cast<T>(0)) {

Explanation:

Since both variables, weight and nms_iou_threshold, are templated and finally boil down to a primitive type during compilation, it is meaningful to use a static_cast to convert the respective constant (1.0 (by default double) and 0 (by default int)) to the template type. Based on the operator candidates the required types should all be compatible, i.e., the constant values are safe to be casted to the target template type.

问题2:

undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'

解决:

https://stackoverflow.com/questions/38729954/error-installing-opencv-on-ubuntu-16-04

cmake 增加 -D BUILD_TIFF=ON

相关推荐
wujian8311几秒前
怎么把Kimi里的表格完整复制到wps内
人工智能·ai·wps·豆包·deepseek·ai导出鸭
Joy T1 分钟前
【碳金融】欧盟CBAM逻辑与“磐石·禹衡”系统的技术对冲分析
人工智能·重构·cbam·碳排放·碳核算·磐石
字节高级特工2 分钟前
C++11(一) 革新:右值引用与移动语义
java·开发语言·c++·人工智能·后端
DO_Community3 分钟前
Token聚合平台 vs 传统云 vs AI原生云,AI推理应用怎么选?
人工智能·agent·token·ai-native·deepseek
码农小旋风4 分钟前
2026最新国内用户Claude Code 开发配置详细手册
人工智能·chatgpt·claude
byte轻骑兵6 分钟前
【LE Audio】CAP精讲[9]:全流程操盘手,解锁CAP核心交互工序
人工智能·音视频·人机交互·le audio·音视频控制
AI科技星7 分钟前
强哥德巴赫猜想(1+1)终极证明(2026 年5月 21 日)
开发语言·人工智能·算法·计算机视觉·量子计算
枫叶林FYL7 分钟前
【强化学习】5 异构机器人数据集的跨具身离线强化学习:形态感知分组与梯度冲突消解
人工智能·系统架构·机器人
Rubin智造社9 分钟前
Claude Code开发者大会系列8:从脚本到智能体——独立开发者的“AI原生”工作流转型
数据库·人工智能·独立开发者·agentic工作流·ai原生开发·实操指南
人工智能导论实践课9 分钟前
奥比中光深度相机astra pro的初步ros包开发
人工智能·python