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

相关推荐
ZeroSilin2 分钟前
Superpowers:为AI编程智能体赋予工程化超能力(安装与配置)
人工智能
云安全助手6 分钟前
OpenClaw失控风暴:Meta两小时Sev1级事故,AI智能体集体黑化敲响全球安全警钟
人工智能·安全
昨夜见军贴061618 分钟前
AI审核守护生命设备安全:IACheck成为呼吸机消毒效果检测报告的智能审核专家
大数据·人工智能·安全
春日见20 分钟前
云服务器开发与SSH
运维·服务器·人工智能·windows·git·自动驾驶·ssh
半吊子全栈工匠1 小时前
面向AI产品经理的统计学基础
人工智能·产品经理
Kel1 小时前
深入 OpenAI Node SDK:一个请求的奇幻漂流
javascript·人工智能·架构
liliwoliliwo1 小时前
yolo3 点
人工智能·深度学习
lifallen1 小时前
从零推导 Deep Agent 模式
人工智能·语言模型
XMAIPC_Robot1 小时前
基于RK3588 ARM+FPGA的电火花数控系统设计与测试(三)
运维·arm开发·人工智能·fpga开发·边缘计算
前端架构师1 小时前
我不是狐狸,我是那Harness Engineering
人工智能