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

相关推荐
xier_ran3 分钟前
【infra之路】AI 编译器学习笔记(七):Linalg 与 Tiling——把迭代空间切成块
人工智能·笔记·学习
高洁014 分钟前
世界模型环境预测与内在表征基础原理
人工智能·深度学习·机器学习·transformer·tornado
沪上企服通7 分钟前
税制变更前的影子账套回归:代账 pipeline 怎么在规则上线前先跑一遍
人工智能·数据挖掘·回归
赶路人儿8 分钟前
简述LLM 中的GCG 攻击
人工智能
m0_587383009 分钟前
碰碰好评卡功能落地实战 从需求梳理到上线部署全流程实操指南
java·linux·服务器·前端·javascript·vue.js·人工智能
半吊子全栈工匠15 分钟前
构建企业级 Agentic AI的语义层
人工智能·语义层·本体驱动的ai大模型
李航198318 分钟前
SketchUp国产平替来了,功能非常接近,还有AI版本自动建模
人工智能·python·计算机视觉·ai·ai编程
玩AI的奶茶18 分钟前
什么情况适合租算力?一张场景对照表,加三个自测问题
大数据·linux·服务器·数据库·人工智能·python
syounger21 分钟前
SAP CTO谈预测AI:能解释业务,不等于能准确预测业务
人工智能
海宇大数据22 分钟前
零信任架构实战:基于海宇企业综合风险报告构建自动化供应链保理对公尽调网关
运维·人工智能·架构·自动化