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

相关推荐
chenglin01620 小时前
AI 服务企业级数据隐私与安全
网络·人工智能·安全
大数据AI人工智能培训专家培训讲师叶梓21 小时前
Merlin:面向腹部 CT 的三维视觉语言基础模型
人工智能·计算机视觉·大模型·医疗·ct·视觉大模型·医疗人工智能
AI_Auto21 小时前
【智能制造】-五大AI场景重塑智能制造
人工智能·制造
ggabb21 小时前
光芯片技术突破与AI算力应用解析
人工智能
大强同学21 小时前
Obsidian CLI + Claude Code = 王炸组合
人工智能·windows·ai编程·cli
工业机器视觉设计和实现21 小时前
微分方程的联想
人工智能·神经网络·感想
罗罗攀1 天前
PyTorch学习笔记|神经网络的损失函数
人工智能·pytorch·笔记·神经网络·学习
枫叶林FYL1 天前
第9章 因果推理与物理理解
人工智能·算法·机器学习
AIBox3651 天前
openclaw api 配置排查与接入指南:网关启动、配置文件和模型接入全流程
javascript·人工智能·gpt
LoserChaser1 天前
OpenClaw 指令大全:分类详解与使用指南
人工智能·ai·语言模型