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

相关推荐
AI人工智能+6 分钟前
应用俄文OCR技术,为跨语言交流与数字化管理提供更强大的支持
人工智能·ocr·文字识别
UQI-LIUWJ17 分钟前
李宏毅LLM笔记: AI Agent
人工智能·笔记
百度Geek说30 分钟前
百度阮瑜:百度大模型应用赋能产业智变|2025全球数字经济大会
人工智能
大明哥_34 分钟前
最新 Coze 教程:40+ 条视频涨粉 10W+,利用 Coze 工作流 + 视频组件,一键制作爆款小人国微景动画视频
人工智能·agent
SugarPPig42 分钟前
ReAct (Reason and Act) OR 强化学习(Reinforcement Learning, RL)
人工智能
孤狼warrior1 小时前
灰色预测模型
人工智能·python·算法·数学建模
AI生存日记1 小时前
AI 行业早报:微软发布诊断工具,上海聚焦四大应用场景
人工智能·microsoft·机器学习·open ai大模型
求职小程序华东同舟求职1 小时前
龙旗科技社招校招入职测评25年北森笔试测评题库答题攻略
大数据·人工智能·科技
李元豪1 小时前
【行云流水ai笔记】粗粒度控制:推荐CTRL、GeDi 细粒度/多属性控制:推荐TOLE、GPT-4RL
人工智能·笔记
机器学习之心1 小时前
小波增强型KAN网络 + SHAP可解释性分析(Pytorch实现)
人工智能·pytorch·python·kan网络