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

相关推荐
凤希AI伴侣几秒前
架构重构与AI能力聚焦:一人开发的自动化未来 凤希AI伴侣 · 开发日记 · 2025年12月20日
人工智能·重构·自动化·凤希ai伴侣
攻城狮7号几秒前
微软开源 TRELLIS.2:单图 3 秒变 3D?
人工智能·3d·trellis.2·o-voxel·sc-vae·微软开源模型
运维@小兵2 分钟前
Spring AI系列——开发MCP Server和MCP Client(SSE方式)
java·人工智能·spring
free-elcmacom3 分钟前
机器学习高阶教程<8>分布式训练三大核心策略拆解
人工智能·分布式·python·机器学习
珂朵莉MM7 分钟前
第七届全球校园人工智能算法精英大赛-算法巅峰赛产业命题赛第一赛季优化题--无人机配送
人工智能·算法·无人机
有为少年13 分钟前
带噪学习 | Ambient Diffusion (NeurIPS 2023)下篇
人工智能·深度学习·神经网络·学习·机器学习·计算机视觉
upper202014 分钟前
数据挖掘12
人工智能·数据挖掘
yohalaser14 分钟前
追光者的“速度游戏“:光伏测试设备的技术迭代之路
人工智能·功能测试·可用性测试
翼龙云_cloud16 分钟前
阿里云云渠道商:如何选择阿里云 GPU 配置方案?
服务器·人工智能·阿里云·云计算
1+2单片机电子设计17 分钟前
基于 STM32 的人脸识别系统
网络·人工智能