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

相关推荐
七牛云行业应用2 分钟前
GLM-5.4 vs DeepSeek V4.1 Flash:同样 1M 上下文,API 价格与输出上限怎么选(2026 年 12 月)
人工智能·ai·开源·ai编程
时文鲜读9 分钟前
2026边缘计算服务商推荐:怎么选
人工智能·边缘计算
陈大鱼头12 分钟前
第一次做 AI 视频,GPT 推荐我先试这两个模型
人工智能·gpt·音视频
涛思数据(TDengine)22 分钟前
TDengine 查询引擎 3.4:概念、功能、性能、维护四维升级全解
大数据·人工智能·tdengine·工业ai
uncle_ll25 分钟前
从分词到词向量:NLP 到底在解决什么问题
人工智能·自然语言处理·nlp
神奇的代码在哪里28 分钟前
Qwen4-35B-A3B 开源:35B 语言模型 / 3B 激活、1M 上下文
人工智能·大模型·通义千问·moe·开源模型·qwen4
热心网友俣先生28 分钟前
人工智能时代的美赛-ICM
人工智能·数学建模
洞见新研社31 分钟前
半年从蓝海杀入红海,机器人数据生意变天了
人工智能·算法·机器人
海宇大数据1 小时前
零信任架构实战:基于海宇企业股权变更构建自动化对公贷后股权异动监测网关
java·人工智能·架构·自动化