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

相关推荐
weelinking43 分钟前
【2026】08_Claude与版本控制:Git协作技巧
数据库·人工智能·git·python·数据挖掘·交互·cloudera
黄焖鸡能干四碗5 小时前
固定资产管理系统建设方案和源码(Java源码)
大数据·数据库·人工智能·物联网·区块链
颖火虫盟主5 小时前
AI DSL — 为 AI Skill 设计“自然语言脚本语法“的探索
人工智能
初学大模型5 小时前
载体的背叛:论脉冲编码在神经形态计算中的物理困境
人工智能
叶子Talk5 小时前
xAI发布Grok Build,全球AI终端展深圳开幕:AI从云端走向终端
人工智能·ai·agent·xai·grok build·终端ai
EAIReport5 小时前
Agent开发+Vibe Coding:数据本体论筑牢AI开发效率与可靠性双防线
大数据·人工智能
MediaTea5 小时前
AI 术语通俗词典:优化器
人工智能
X54先生(人文科技)6 小时前
《元创力》纪实录·实战篇先卷后观:碳硅对位范式的首次实战归档
人工智能·ai写作·开源协议
Risk Actuary6 小时前
快速傅里叶变换与聚合风险精算模型
人工智能·深度学习·机器学习
莱歌数字6 小时前
ANSYS模拟仿真不锈钢件激光焊接变形量
人工智能·科技·电脑·制造·散热