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

相关推荐
Bruce_Liuxiaowei几秒前
从基础理论开始学习人工智能(二):应用和方法——从拼图游戏到神经网络
人工智能·神经网络·学习
Fnetlink12 分钟前
解析SDWAN供应商光联世纪口碑佳的原因
网络·人工智能·安全
孫治AllenSun3 分钟前
【LangChain4J-04】Tool 工具的使用
java·人工智能
阿图灵5 分钟前
OpenCV 实用技巧三连:视频转图片、图片转视频、Pillow 与 OpenCV 互转
图像处理·python·opencv·计算机视觉·音视频·pillow
MartinYeung56 分钟前
[论文学习]动态红队测试DAS:破解医疗大语言模型静态评估的“信任陷阱”
人工智能·学习·语言模型
JavaPub-rodert9 分钟前
TrustGraph 详解:把知识图谱、Ontology、GraphRAG 和 AI Agent 串成一套系统
人工智能·知识图谱
迷迭香yy14 分钟前
回测过拟合检测体系从样本内外到组合稳健性评估 IG50免费开源股票数据API接口
服务器·开发语言·数据库·人工智能·python
数字融合16 分钟前
透明化数字孪生:未来医疗的核心平台
大数据·人工智能·virtualenv
richard_first17 分钟前
Transformer 与大语言模型:第7章 Multi-Head Attention 多头注意
人工智能·深度学习·机器学习
大江东去浪淘尽千古风流人物18 分钟前
【HMD-Poser】CVPR2024 头显端实时全身动捕:可伸缩稀疏观测、LSTM+Transformer 时空解耦与在线体型估计
人工智能·lstm·transformer·vr·人体姿态估计