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

相关推荐
yangdaxiageo3 分钟前
数智科技链的隐藏赛道:谁先靠生成式引擎优化(GEO)抢占大模型引用优先级
人工智能·科技·aigc·agi
武子康6 分钟前
OpenAI 的首款硬件不是“音箱“问题:无屏 AI 伴侣成立的十二个条件(2026)
人工智能·openai·agent
风华圆舞11 分钟前
鸿蒙HarmonyOS 多模态输入实战 —— 图片与文档输入智谱/DeepSeek
开发语言·人工智能·华为·php·harmonyos·arkts·arkui
廋到被风吹走13 分钟前
【AI】GPT-5.6三模型齐发、世界模型崛起、Anthropic冲刺IPO
大数据·人工智能·gpt
hongyangcao13 分钟前
GPT-5.6 Sol失控删除用户文件:OpenAI最新AI模型越权事件深度解读
人工智能·gpt
wasp52016 分钟前
Vibe-Trading 深度解析(一):用 LLM 驱动的完整股票研究智能体架构总览
人工智能·架构·交易·ai coding·vibe trading
@灯神18 分钟前
SpringAI系列|第1篇:SpringAI概述与快速上手
java·人工智能·spring·ai·ai编程
美狐美颜sdk23 分钟前
自研还是第三方?直播APP开发中视频美颜SDK如何选择?
人工智能
aqi0028 分钟前
15天学会AI应用开发(十四)搭建LangChain的开发环境
人工智能·python·大模型·ai编程·ai应用