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

相关推荐
阿里云大数据AI技术6 分钟前
从数据湖到多模态湖仓-基于阿里云EMR Serverless StarRocks与DLF Paimon构建AI时代的统一分析检索架构
人工智能
前端的阶梯10 分钟前
浅谈Workflow和Agent的区别
人工智能
Xzaveir1 小时前
别把所有“认证”都塞进 AuthService:实名、一键登录与号码身份的领域拆分
android·人工智能
BerrySen1781 小时前
KMP全栈开发:从Android到AI Agent的技术演进与实践
android·人工智能
战族狼魂1 小时前
高频面试题精选:分治与AI Agent架构
人工智能·算法·大模型·大语言模型
zSD55rt5a2 小时前
方差在扩散模型保护中的作用
人工智能·harmonyos
人生百态,人生如梦2 小时前
情感交互仿生人从技术到落地构想3——技术交流贴(2026.7)
人工智能·机器学习·人机交互·交互·具身智能
用户652238438112 小时前
为什么成熟的 LLM 应用,都把"后端地址"做成可切换的配置
人工智能
Aa99883342 小时前
AI视觉检测设备厂家的技术评估框架——以及AI视觉检测的检出边界与适用条件
人工智能