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

相关推荐
机 _ 长3 分钟前
YOLO26 蒸馏改进全攻略:从理论到实战 (Response + Feature + Relation)
人工智能·深度学习·yolo·目标检测·计算机视觉
shangjian0076 分钟前
AI-大语言模型LLM-Transformer架构2-自注意力
人工智能·语言模型·transformer
2501_941507947 分钟前
基于YOLOv26的文档手写文本与签名识别系统·从模型改进到完整实现
人工智能·yolo·目标跟踪
_ziva_10 分钟前
Layer Normalization 全解析:LLMs 训练稳定的核心密码
人工智能·机器学习·自然语言处理
莫潇羽10 分钟前
Midjourney AI图像创作完全指南:从零基础到精通提示词设计与风格探索
人工智能·midjourney
棒棒的皮皮11 分钟前
【OpenCV】Python图像处理矩特征之矩的计算/计算轮廓的面积
图像处理·python·opencv·计算机视觉
加加今天也要加油13 分钟前
Oinone × AI Agent 落地指南:元数据即 Prompt、BPM 状态机护栏、SAGA 补偿、GenUI
人工智能·低代码·prompt
人工智能AI技术16 分钟前
【Agent从入门到实践】41 部署方式选型:本地脚本、Docker容器、云服务部署
人工智能·python
组合缺一20 分钟前
论 AI Skills 分布式发展的必然性:从单体智能到“云端大脑”的跃迁
java·人工智能·分布式·llm·mcp·skills
Baihai IDP22 分钟前
微调后的Qwen3-4B在多项基准测试上战平或胜过GPT-OSS-120B
人工智能·ai·slm