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

相关推荐
科技动态17 分钟前
BOE(京东方)“焕新2026”年终媒体智享会落地成都 三大显示技术品牌引领行业发展风潮
大数据·人工智能·媒体
魔镜前的帅比28 分钟前
向量数据库原理
数据库·人工智能
沃达德软件33 分钟前
警务大数据实战模型解析
大数据·人工智能
Slaughter信仰2 小时前
图解大模型_生成式AI原理与实战学习笔记前四张问答(7题)
人工智能·笔记·学习
龙腾亚太2 小时前
大模型十大高频问题之五:如何低成本部署大模型?有哪些开源框架推荐?
人工智能·langchain·llm·智能体·大模型培训
信息快讯2 小时前
【人工智能与数据驱动方法加速金属材料设计与应用】
人工智能·材料工程·金属材料·结构材料设计
c#上位机2 小时前
halcon图像增强——emphasize
图像处理·人工智能·计算机视觉·c#·上位机·halcon
老蒋新思维2 小时前
创客匠人峰会洞察:私域 AI 化重塑知识变现 —— 创始人 IP 的私域增长新引擎
大数据·网络·人工智能·网络协议·tcp/ip·创始人ip·创客匠人