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

相关推荐
sunny86511 分钟前
Claude Code 跨会话上下文恢复:从 8 次纠正到 0 次的工程实践
人工智能·开源·github
小笼包包仔26 分钟前
OpenClaw 多Agent软件开发最佳实践指南
人工智能
smallyoung36 分钟前
AgenticRAG:智能体驱动的检索增强生成
人工智能
_skyming_42 分钟前
OpenCode 如何做到结果不做自动质量评估,为什么结果还不错?
人工智能
南山安1 小时前
手写 Cursor 核心原理:从 Node.js 进程到智能 Agent
人工智能·agent·设计
掘金安东尼1 小时前
如何为 AI 编码代理配置 Next.js 项目
人工智能
aircrushin2 小时前
轻量化大模型架构演进
人工智能·架构
文心快码BaiduComate3 小时前
百度云与光本位签署战略合作:用AI Agent 重构芯片研发流程
前端·人工智能·架构
风象南3 小时前
Claude Code这个隐藏技能,让我告别PPT焦虑
人工智能·后端
Mintopia4 小时前
OpenClaw 对软件行业产生的影响
人工智能