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

相关推荐
喵个咪7 小时前
补全如水,代理如刀:AI 编程的两本账与两种未来
人工智能·llm·mvp
如若1237 小时前
FIND:频域不变性解耦助力LiDAR 3D检测测试时自适应
人工智能·yolo·目标检测·计算机视觉·3d
织码weavecodes7 小时前
Spring Boot 接入 AI 图像生成:模型适配、图片转存与 Redis 清理
人工智能·spring boot·redis
Csvn8 小时前
WorkBuddy 使用指南:确实需要时再配 MCP
人工智能
Csvn8 小时前
重试到死不如快失败:熔断器三态状态机,让持续故障 1ms 拒绝(A02)
人工智能
陈嘿萌8 小时前
ACM MM 2026|厦门大学 Bio-PCNet:生物启发的复杂退化下多模态海事感知
人工智能·深度学习·计算机视觉·图像融合·学术研究与理论基础
数字供应链安全产品选型9 小时前
从 Skill 安全准入到 Agent 运行时防护,问境 AgentAI 打通企业智能体规模化落地的安全关卡
人工智能·安全
掘金安东尼9 小时前
任务成功率从 60% 做到 99%:Strands Evals 的运行框架优化
人工智能
Cosolar9 小时前
当 Harness 标准化后,工程师还剩什么?
人工智能·后端·agent
Wellijohn9 小时前
大模型推理为什么这么贵?从 KV Cache 到投机解码的一线优化实录
人工智能·性能优化·llm