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

相关推荐
Aaron_9459 分钟前
LangChain:构建大语言模型应用的革命性框架深度解析
人工智能·语言模型·langchain
乐居生活官24 分钟前
湖南粒界教育科技有限公司:专注影视技能培养,AI辅助教学提升学员就业竞争力
人工智能·科技
安徽必海微马春梅_6688A34 分钟前
实验a 信息化集成化生物信号采集与处理系统
大数据·人工智能·深度学习·信号处理
野豹商业评论1 小时前
千问App全球首发点外卖、买东西、订机票等AI购物功能
大数据·人工智能
独自破碎E1 小时前
说说Copilot模式和Agent模式的区别
人工智能·语言模型·copilot
yhdata1 小时前
2026年镍合金线行业产业链分析报告
大数据·人工智能
jiguanghover1 小时前
Langgraph_通过playwright mcp执行自动化
人工智能·agent
清 澜1 小时前
大模型扫盲式面试知识复习 (二)
人工智能·面试·职场和发展·大模型
kevin 11 小时前
财务审核场景全覆盖,AI智能审核,自然语言配置规则
人工智能
jieshenai1 小时前
BERT_Experiment_Template 多种模型与数据集加载,训练、参数保存与评估,适合论文实验的代码模板项目
人工智能·深度学习·bert