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

相关推荐
码农水水12 分钟前
大疆Java面试被问:TCC事务的悬挂、空回滚问题解决方案
java·开发语言·人工智能·面试·职场和发展·单元测试·php
财迅通Ai13 分钟前
暗盘收涨24.61% MiniMax将于明日正式港股上市
人工智能
AI猫站长14 分钟前
快讯|腾讯ULTRALOGIC用“负分奖励”训练推理,北航SIAMD用“结构信息”反制AI水军,AI治理技术能否跟上AI生成技术的步伐?
人工智能·搜索引擎
木头左15 分钟前
基于集成学习的多因子特征融合策略在指数期权方向性预测中的应用
人工智能·机器学习·集成学习
CoderJia程序员甲25 分钟前
GitHub 热榜项目 - 日榜(2026-1-7)
人工智能·ai·大模型·github·ai教程
s090713626 分钟前
【综述】前视二维多波束成像声呐(FLS)图像处理算法全解析:从成像到深度学习
图像处理·人工智能·算法·声呐·前视多波束
shdwak....sad26 分钟前
DeepAudit AI多智能体代码审计项目学习与解读(四)
人工智能·安全
声网30 分钟前
旧金山活动丨聊聊 AI 客服和 AI Call Agent,Conversational AI Meetup@SF,1 月 12 日
人工智能
幂律智能31 分钟前
2025年终回顾 | AI向实,共赴山海
人工智能·经验分享
星河耀银海34 分钟前
人工智能从入门到精通:机器学习基础算法实战与应用
人工智能·算法·机器学习