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

相关推荐
火山引擎开发者社区12 分钟前
OpenClaw 快速上手:把云手机变成你的 7×24 小时 AI 手机助手
人工智能
Qlly12 分钟前
DDD 架构为什么适合 MCP Server 开发?
人工智能·后端·架构
Lee川18 分钟前
从零构建智能对话系统:AI Agent 实战指南
人工智能
冬奇Lab42 分钟前
一天一个开源项目(第43篇):Star-Office-UI - 像素风格的 AI 办公室看板,让 AI 助手的工作状态可视化
人工智能·开源·资讯
风象南1 小时前
纯文本模型竟然也能直接“画图”,而且还很好用
前端·人工智能·后端
IT_陈寒1 小时前
Vite vs Webpack:5个让你的开发效率翻倍的实战对比
前端·人工智能·后端
摆烂工程师3 小时前
GPT-5.4 发布!再看 OpenClaw:AI 真正危险的,不是更会聊天,而是开始自己“干活”
人工智能·openai·ai编程
飞哥数智坊12 小时前
分享被迫变直播:AI·Spring养虾记就这样上线了
人工智能
Mr_Lucifer15 小时前
「一句话」生成”小红书“式金句海报(CodeFlicker + quote-poster-generator)
人工智能·aigc·visual studio code
冬奇Lab15 小时前
OpenClaw 深度解析(五):模型与提供商系统
人工智能·开源·源码阅读