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

相关推荐
Vaxmzzy9 分钟前
AI直播浪潮下的行业重构:从“人海战术”到“智能基建”
人工智能·重构
朴马丁11 分钟前
国际与国产PLM在精细化工赛道的布局:2026年主要厂商技术特色
大数据·运维·人工智能·流程行业plm·化工新材料
狂奔蜗牛(bradley)30 分钟前
深度学习三大基础激活函数详解:Sigmoid、Tanh、ReLU 公式、导数、图像与优缺点对比
人工智能·深度学习
阿里云大数据AI技术33 分钟前
借助 EMR Serverless StarRocks 实现电商平台图搜图、文搜图场景
人工智能
不吃辣49043 分钟前
vibe coding | 如何做一个AI制图小程序?
人工智能·小程序·ai编程
船厂电气自动化ai大模型1 小时前
AI大模型与数学 第32课 函数凹凸性与二阶导数:拐点求解、凹凸区间计算(10道二阶导数计算题)
数据结构·人工智能·python·深度学习·算法
张彦峰ZYF1 小时前
LangGraph 深入理解 ReAct:让 AI Agent 真正学会「边想边做」
人工智能·llm·agent·react·langgroup
~央千澈~1 小时前
从“拟声”到“生成”:AI音效背后的技术原理·优雅草AI音乐·AI音乐技术研究
大数据·人工智能·ai·音频
啾啾Fun1 小时前
【AI原生组织】6-AI Native团队组建与基础设施搭建
人工智能·chatgpt·ai-native·ai agent·ai原生组织·人机混编
IT_陈寒1 小时前
Redis集群这个坑,差点让我通宵
前端·人工智能·后端