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

相关推荐
MyBFuture4 分钟前
Halcon条形码与二维码识别全攻略
开发语言·人工智能·halcon·机器视觉
老鱼说AI6 分钟前
大模型学习与面试精讲第六期:损失函数篇
人工智能·深度学习·神经网络·学习·机器学习·语言模型
安科瑞小许7 分钟前
零碳园区的“神经网络”——能源数据如何高效传输与监控
人工智能·零碳园区
Codebee12 分钟前
Apex 技能安装过程深度技术揭秘
人工智能
dev派13 分钟前
【LangChain】Context与Runtime:运行时数据注入完全指南
人工智能
拓端研究室25 分钟前
2026年医疗趋势报告:医保改革、创新药、国产替代|附230+份报告PDF、数据、可视化模板汇总下载
大数据·人工智能
ages_12341 分钟前
剪流AI智能手机用户真实使用体验分享:实测自动拓客与成交全解析
人工智能·智能手机
Yao.Li41 分钟前
PVN3D TensorRT 环境配置指南
人工智能·python·具身智能
薛定猫AI1 小时前
【深度解析】从 Claude Mythos 到自进化 Agent:下一代 AI 智能体技术栈与落地实践
网络·人工智能