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

相关推荐
2501_942191771 分钟前
手部姿态识别与数字手势分类:Cascade RCNN_R101_FPN模型在COCO数据集上的实践与优化_3
人工智能·分类·数据挖掘
iceslime1 分钟前
HENU2025OS操作系统期末考试
大数据·人工智能
努力的小白o(^▽^)o2 分钟前
回归实战(小白版本)
人工智能·数据挖掘·回归
5Gcamera8 小时前
4G body camera BC310/BC310D user manual
人工智能·边缘计算·智能安全帽·执法记录仪·smarteye
爱喝可乐的老王8 小时前
机器学习中常用交叉验证总结
人工智能·机器学习
公链开发9 小时前
2026 Web3机构级风口:RWA Tokenization + ZK隐私系统定制开发全解析
人工智能·web3·区块链
wyw00009 小时前
目标检测之YOLO
人工智能·yolo·目标检测
发哥来了9 小时前
AI视频生成企业级方案选型指南:2025年核心能力与成本维度深度对比
大数据·人工智能
_codemonster10 小时前
强化学习入门到实战系列(四)马尔科夫决策过程
人工智能
北邮刘老师10 小时前
智能体治理:人工智能时代信息化系统的全新挑战与课题
大数据·人工智能·算法·机器学习·智能体互联网