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

相关推荐
ai小陈13 小时前
PyTorch梯度累积与裁剪实战:小显存也能稳定训练大批次
人工智能·pytorch·python·深度学习·ai·gpu算力
心易行者13 小时前
用HTML在线运行搭后台管理系统:5个核心模块+0服务器,3天跑通完整业务
大数据·前端·网络·人工智能·python
不爱学英文的码字机器13 小时前
让 Live2D 角色真正开始对话:Open-LLM-VTuber 从本地部署到远程访问
服务器·opencv·微信·电脑
CubeSandbox13 小时前
Cube Sandbox 受邀亮相 Arm Create 上海站:金峰将参与“领袖对谈”,共话 AI Agent 执行层
arm开发·人工智能·cube sandbox
通问AI13 小时前
【实战】多模态图像模型批量生成电商主图:Prompt 模板化与自动化质检方案
人工智能·自动化·prompt
易知微EasyV数据可视化13 小时前
从一个 SVG 清洗工具开始:设计师 howto 零帧起手开发 Figma 插件
人工智能·figma
kaixin_啊啊13 小时前
中国研究生数学建模竞赛(华为杯)学习笔记——数据预处理全流程
人工智能·笔记·学习·数学建模·ai·大模型·数据预处理
醍醐实验室13 小时前
基准测试的自动化报告生成:从 JSON 指标到交互式 HTML 图表
人工智能
小飞象—木兮13 小时前
BCG波士顿矩阵深度解析及应用指南:核心逻辑、落地路径、常见误区、案例
大数据·人工智能·矩阵·数据分析·用户运营