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

相关推荐
Solara1 分钟前
一个标志位挂了 18 天不落地:它等的重启,2 天 14 小时后就完成了
人工智能·程序员·ai编程
xz2024102****2 分钟前
agent基础知识:function calling,MCP,和Skill
大数据·人工智能·agent
格物致胜工业数智技术5 分钟前
锂电纠偏测量那些坑,明治ETD-0612激光纠偏传感器怎么填?
人工智能·算法
远航计算机6 分钟前
AI 答案里的链接,为什么开始分等级了?
大数据·人工智能·爬虫·aigc
LDG_AGI6 分钟前
【口袋专家AI公开课】从0到1智能体开发(八):法律专家Agent原理与实战
人工智能
逐步走向自律11 分钟前
运维手机应急 + 电脑多终端并行:2026 远程终端选型指南
人工智能·深度学习·机器学习·自然语言处理·数据科学
海带紫菜菠萝汤16 分钟前
本周 AI 观察:算力、路由、账本——护城河正搬出模型层
人工智能·ai·程序员·架构·大模型
Wild API17 分钟前
蒸馏小模型:独立答题和给大模型打草稿,差在哪里?
人工智能·大模型·知识蒸馏
zt_vicky18 分钟前
策略产品视角下的机器学习与知识图谱:从业务需求到模型落地
人工智能·机器学习·知识图谱
AI码上来20 分钟前
我把“打电话“和“对讲机“做进了同一个页面
人工智能·实时音视频