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

相关推荐
Cosolar4 分钟前
从 ChatGPT 到 Astra:四年走完的路,AGI 真的来了吗?
人工智能·aigc·openai
ting94520007 分钟前
Dograh 深度技术解析:开源自托管语音智能体平台架构、流水线与工程实践
人工智能·架构
思考着亮8 分钟前
13.GraphRAG
人工智能
HappyEnding11 分钟前
OpenSpec + Superpowers 搭建 SDD+TDD 工作流教学文档
人工智能
思考着亮19 分钟前
12.Agentic RAG
人工智能
zed_2322 分钟前
让答案有出处:citations 引用溯源
人工智能
长江后浪博客30 分钟前
Python + YOLOv8 疲劳驾驶 AI 视觉检测入门:从模型训练到 ONNX 实时摄像头检测完整实战
人工智能·python·yolo·疲劳驾驶检测·onnx·yolov8
聪明蛋子哟37 分钟前
告别API“翻译”之苦:从OpenAPI到MCP,统一AI与工具集成的桥梁
人工智能
海上小飞龙39 分钟前
大模型推理的两阶段:一次 Prefill,加上多次 Decode
人工智能·深度学习·语言模型
hhzz1 小时前
【OpenCV 入门到精通 01】认识 OpenCV 与计算机视觉:从零建立全局认知
人工智能·python·opencv·计算机视觉·开源