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

相关推荐
shxjnpl4 小时前
Qwen3-ForcedAligner-0.6B 私有化部署实战:从模型离线、Docker封装到会议原声精准回听
人工智能·语音识别·智能硬件
HZZD_HZZD4 小时前
分时电价_园区峰谷电费优化
大数据·人工智能·能源·制造
星辰AI4 小时前
前端性能优化实战:从首屏加载到交互响应的全链路调优
人工智能·ai·语言模型
Mr数据杨4 小时前
餐厅评分预测实战案例 从结构化特征到回归建模落地
人工智能·数据分析·kaggle竞赛
m0_587383005 小时前
折扣卡CPS系统源码的技术架构与实战开发指南
人工智能·小程序·数据挖掘·系统架构·需求分析
资讯综合5 小时前
河北被动防护网厂家哪家强 5个选型标准帮你选
人工智能
学Linux的语莫5 小时前
LangChain Prompts 提示词模板
数据库·人工智能·langchain
知几蜗牛5 小时前
Agent到底比一次大模型调用多了什么?小白从这张流程图看懂
人工智能
张彦峰ZYF5 小时前
Prefactor 从“看见 Agent”到“拦住 Agent”:实时评估如何重构 AI Agent 的生产可靠性
人工智能·llm·ai agent·evaluate·llm-as-a-judge·prefactor·金融agent
知几蜗牛5 小时前
语音AI开始边听边说,改变的不只是响应速度
人工智能