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_941149114 分钟前
人工智能驱动下的边缘物联网革新,打造未来全球智能互联新格局
人工智能·物联网
没头脑的男大8 分钟前
Unet+Transformer脑肿瘤分割检测
人工智能·深度学习·transformer
AI即插即用13 分钟前
即插即用涨点系列(十四)2025 SOTA | Efficient ViM:基于“隐状态混合SSD”与“多阶段融合”的轻量级视觉 Mamba 新标杆
人工智能·pytorch·深度学习·计算机视觉·视觉检测·transformer
1***815337 分钟前
免费的自然语言处理教程,NLP入门
人工智能·自然语言处理
Juchecar42 分钟前
从微观到宏观:视觉和听觉的区别
计算机视觉
算家计算1 小时前
Gemini 3.0重磅发布!技术全面突破:百万上下文、全模态推理与开发者生态重构
人工智能·资讯·gemini
说私域1 小时前
“开源链动2+1模式AI智能名片S2B2C商城小程序”赋能同城自媒体商家营销创新研究
人工智能·小程序·开源
m0_635129261 小时前
内外具身智能VLA模型深度解析
人工智能·机器学习
zhougoo1 小时前
AI驱动代码开之Vs Code Cline插件集成
人工智能
minhuan2 小时前
构建AI智能体:九十五、YOLO视觉大模型入门指南:从零开始掌握目标检测
人工智能·yolo·目标检测·计算机视觉·视觉大模型