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

相关推荐
RSTJ_1625几秒前
PYTHON+AI LLM DAY FIFITY-FIVE
人工智能
jay神2 分钟前
垃圾分类识别数据集 | YOLO格式
人工智能·深度学习·目标检测·机器学习·计算机视觉
MobotStone2 分钟前
用 AI 写 PRD 的人越来越多,但真正会用的人不到 10%
人工智能
架构谨制@涛哥4 分钟前
本体从入门到实战-03.为什么AI需要一个本体层?
人工智能·架构·软件工程·软件构建
ACP广源盛139246256734 分钟前
OpenAI 推出的 GPT-5.5 大模型,倒逼接口芯片升级迭代@ACP#IX8012应用迭代
大数据·网络·人工智能·嵌入式硬件·电脑·音视频
Python私教7 分钟前
GPT-5.6 泄露信息汇总:预计六月发布
人工智能
Everybody_up9 分钟前
大模型开发中format_messages、invoke、format三种方法的对比
人工智能·python·大模型
weixin_4462608510 分钟前
超人级安全敏捷多智能体强化学习飞行动力系统
人工智能
阳艳讲ai11 分钟前
九尾狐AI 2026年战略级更新:专注1对1深度陪跑,重新定义中小企业AI落地实战与变现的行业服务标准
大数据·人工智能·企业ai培训·九尾狐ai
动物园猫11 分钟前
人体姿态检测数据集分享(适用于YOLO系列深度学习检测任务)
人工智能·深度学习·yolo