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

相关推荐
火山引擎开发者社区9 分钟前
DeepSeek-V4 Pro 发布,veStack Day 0 完成模型适配
人工智能
2501_9269783311 分钟前
AGI 的四种瓶颈:资源型还是发现型--以及DSH的位置
人工智能·经验分享·笔记·ai写作
Q4639134920 分钟前
线下销售复盘难落地,AI 会话设备能帮上啥忙
人工智能·自然语言处理
ebok.22 分钟前
国产大模型落地业务系统的优选载体:京微智枢信创 AI 业务支撑平台
大数据·人工智能·低代码·ai
wujian831137 分钟前
怎么用文心生成word文档?从格式错乱到智能导出,AI导出鸭让创作再无后顾之忧
人工智能·ai·word·豆包·deepseek·ai导出鸭
动物园猫1 小时前
猪危险行为目标检测数据集:3类别、5,000+张图像 | 目标检测
人工智能·目标检测·计算机视觉
ai产品老杨1 小时前
AI视频分析并发优化完整流程:解决多路视频并发不足与高延迟排查指南
人工智能·音视频
why技术2 小时前
AI 写的文章,可能都带着手敲一遍都去不掉的“隐形水印”。
前端·人工智能·后端
罗西的思考2 小时前
【Agent OS / AIOS】AOHP 深度解读:当 OS 开始为 Agent 而设计
人工智能·算法·机器学习
新知图书2 小时前
8.2 智能体的心跳执行模式:以智能体为核心(智能体工程)
人工智能·agent·ai agent·智能体