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

相关推荐
硅基流动1 分钟前
OPC 南川:超级个体的疯狂探索|开发者说
人工智能
147API6 分钟前
AI 图片编辑接口报 400 怎么排查?先读错误体,再查参数、图片与 mask
网络·人工智能
xiaoxiaoxiaolll11 分钟前
AI-有限元融合的复合材料多尺度建模与性能
人工智能
zyplayer-doc16 分钟前
同一份制度别复制到多个知识库:用zyplayer-doc引用文档解决重复维护
javascript·人工智能·智能手机·开源·ocr
ASKED_201921 分钟前
从 Chat Completions 到 Agent Runtime:主流大模型接口协议全景与设计对比
人工智能
站长工具箱25 分钟前
讯飞Loomy测评:整合飞书钉钉QQ消息的AI自动办公工具深度体验
人工智能·钉钉·飞书
小刘快学习26 分钟前
广告素材生产,直连模型还是走聚合网关
人工智能
Wang's Blog31 分钟前
AI Agent白手起家46: LangChain 向量数据库实战 — 从增删查到高级检索
人工智能
QYR_Jodie36 分钟前
高增赛道爆发!2026-2032工业制冷市场分析:预计2032年将达到174.4亿美元
大数据·人工智能·市场报告
戴西软件40 分钟前
戴西CAxWorks.VPG车辆工程仿真软件技术解析(上)——安全仿真体系的自动化构建
运维·网络·数据库·人工智能·算法·安全·自动化