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

相关推荐
nn在炼金3 分钟前
大模型领域负载均衡技术
人工智能·算法·负载均衡
久菜盒子工作室9 分钟前
【A股复盘】2025.12.30
人工智能·经验分享·金融
EMQX14 分钟前
利用 EMQX 消息队列解决关键物联网消息传递挑战
人工智能·后端·物联网·mqtt·emqx
凌峰的博客19 分钟前
基于深度学习的图像修复技术调研总结(下)
人工智能·深度学习
知识进脑的肖老千啊24 分钟前
LangGraph简单讲解示例——State、Node、Edge
人工智能·python·ai·langchain
Deepoch27 分钟前
智能硬件新纪元:Deepoc开发板如何重塑机器狗的“大脑”与“小脑”
人工智能·具身模型·deepoc·机械狗
Mintopia28 分钟前
🐱 LongCat-Image:当AI绘画说上了流利的中文,还减掉了40斤参数 | 共绩算力
人工智能·云原生·aigc
Mintopia28 分钟前
量子计算会彻底改变 AI 的运算方式吗?一场关于"量子幽灵"与"硅基大脑"的深夜对话 🎭💻
人工智能·llm·aigc
natide29 分钟前
表示/嵌入差异-4-闵可夫斯基距离(Minkowski Distance-曼哈顿距离-欧氏距离-切比雪夫距离
人工智能·深度学习·算法·机器学习·自然语言处理·概率论
蹦蹦跳跳真可爱58943 分钟前
Python----大模型(GPT-2模型训练,预测)
开发语言·人工智能·pytorch·python·gpt·深度学习·embedding