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

相关推荐
吴佳浩1 小时前
什么?有人手写 Skill?Agent Skill?Skill?
人工智能·llm·agent
俊哥V5 小时前
每日 AI 研究简报 · 2026-05-21
人工智能·ai
2601_957884846 小时前
深度拆解:大模型RAG架构下,GEO优化的技术实现路径
人工智能·架构
这个DBA有点耶6 小时前
DBA的AI助手:向量检索与NL2SQL入门
数据库·人工智能·postgresql·学习方法·dba
YOLO数据集集合6 小时前
无人机航拍林业树种分割|单木树冠检测|三维点云|遥感影像数据集10059期
人工智能·yolo·目标检测·无人机
Pocker_Spades_A6 小时前
工业智能化的时序选型指南:当数据底座遇见机器学习
人工智能·机器学习
2601_955781986 小时前
飞书远程控机:OpenClaw配置全攻略
人工智能·开源·github·飞书·open claw安装·open claw部署
Inhand陈工7 小时前
游轮WiFi覆盖方案复盘:6台5G CPE + AP实现全船高速上网
人工智能·物联网·网络协议·网络安全·信息与通信·iot
程序猿追7 小时前
在 HarmonyOS 模拟器上种出斐波那契螺旋线
大数据·人工智能·microsoft·华为·harmonyos
:mnong7 小时前
跟着 Sesame Robot 项目学习
人工智能·robot·esp