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

相关推荐
黄啊码24 分钟前
【黄啊码】程序员真正该担心的,不是 AI 会写代码
人工智能
weixin_468466851 小时前
Ava 2.0 智能应用场景落地指南
人工智能·自然语言处理·大模型·智能交互·ava
John_ToDebug1 小时前
MCP 深度解析:大模型的“万能插头”
人工智能·经验分享·ai
浦信仿真大讲堂1 小时前
CST 仿真软件与 AI 融合的工程应用实战
人工智能·仿真软件·达索仿真·达索软件
mit6.8241 小时前
A Software Engineer‘s Apology | CODA
人工智能
段一凡-华北理工大学2 小时前
2026 高炉炼铁智能化技术全景与演进路径~系列文章11:演进路径与行业未来
大数据·网络·人工智能·算法·工业智能体·高炉炼铁智能化
搞科研的小刘选手2 小时前
【中山大学主办】第六届计算机科学与区块链国际学术会议(CCSB 2026)
分布式·神经网络·计算机视觉·区块链·计算机科学·共识算法·自然语言
小脑斧1232 小时前
AI技能化落地:从对话式大模型到可生产、可复用的AI工程体系
人工智能·skills·openclaw·hermes·marvis
西陵2 小时前
Agent 为什么会陷入 Doom Loop?OpenClaw 的破解之道
前端·人工智能·ai编程
飞哥数智坊2 小时前
动动嘴皮子就把事干了,Mic Air + TRAE SOLO 让我越来越懒
人工智能