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

相关推荐
齐齐大魔王4 分钟前
OpenCV
人工智能·opencv·计算机视觉
老蒋新思维15 分钟前
创客匠人峰会实录:创始人 IP 变现的 “人 + 智能体” 协同范式 —— 打破知识变现的能力边界
大数据·网络·人工智能·网络协议·tcp/ip·创始人ip·创客匠人
_codemonster15 分钟前
深度学习实战(基于pytroch)系列(四十八)AdaGrad优化算法
人工智能·深度学习·算法
AI即插即用35 分钟前
即插即用系列 | Attention GhostUNet++:基于多维注意力和 Ghost 模块的高效 CT 图像脂肪与肝脏分割网络
网络·图像处理·人工智能·深度学习·神经网络·计算机视觉·视觉检测
猎人everest1 小时前
LangChain 与其他大语言模型框架有什么区别
人工智能·语言模型·langchain
jkyy20141 小时前
端到端生态闭环:智能硬件+云平台+应用终端,最大化穿戴设备价值
大数据·人工智能·物联网·健康医疗
新程记2 小时前
2025年CAIE认证含金量透视:它如何成为AI时代的“技能护照”?
人工智能
学历真的很重要2 小时前
PyTorch 机器学习工作流程基础 - 完整教程
人工智能·pytorch·后端·python·深度学习·机器学习·面试
百度Geek说2 小时前
百度慧播星数字人技术演进
人工智能