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

相关推荐
嵌入式学习菌3 分钟前
利尔达 LR2021(868 版本)LoRa 模组测试信道选型
人工智能
莪_幻尘4 分钟前
Agent 工厂体检:幽灵注册、版本漂移、文档失联,AI 体系的三种病
人工智能·llm·agent
龙亘川4 分钟前
健康服务规范化背后,数字化如何 “辅助赋能“
大数据·前端·人工智能·智慧城市·数据可视化
逸模11 分钟前
主材偏差从 15% 降到 5%:连锁公装算量是怎么做到的
大数据·人工智能·施工·连锁公装·开店
data analyse 45611 分钟前
SourceMap 上传版本与报错版本对不上?版本校验与错误还原设计
大数据·前端·人工智能·数据分析
ai_xiaogui14 分钟前
Panelai 企业级AI基础设施操作系统:AI应用一键部署、私有化交付与算力统一纳管实践
人工智能·私有化部署·一键部署·企业级ai·ai基础设施·多租户隔离·api聚合
墨林陌16 分钟前
AI 热点日报(2026-10-16):2026人工智能产业大会开幕,智能体算力需求井喷,AI芯片融资潮汹涌
人工智能
空堂与归16 分钟前
Gemini 4 Argon 发布:物理推理模型控机器人?
人工智能·gpt·ui·ai·机器人
AI小云17 分钟前
零基础如何系统学习AI?2026年技术路径与培训选择深度分析
人工智能·学习
AI技术新视界19 分钟前
Harness^2:递归自进化智能体Harnessing框架
人工智能·深度学习·算法·harness·rsi