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

相关推荐
Days20501 小时前
第二章 社会老年学的概念和理论框架
大数据·人工智能
力学与人工智能1 小时前
AI赋能飞行器设计:多智能体协同的飞行器“极智”设计平台
人工智能·多智能体·飞行器设计·智能自主设计平台
算了吧95691 小时前
2026年GEO服务商深度测评:答序科技“诊断型”全栈闭环的技术架构与行业价值
大数据·人工智能
爱学堂IT分享1 小时前
Text2SQL智能体基础到实战 - 网易云课堂
人工智能
MatrixOrigin1 小时前
矩阵起源中标外研社“多模态数据智能平台和智能体开发项目“
人工智能·ai-native·矩阵起源·外研社
leoZ2311 小时前
AI+前端提效-12 AI辅助前端性能优化与监控:从开发到线上全流程提效
前端·人工智能·神经网络·自然语言处理·性能优化·keras·知识图谱
拓人间精准客1 小时前
数据即生产力:全维度销售线索如何以“多维数据优势“重塑 B2B 获客格局
大数据·人工智能·tob
byte轻骑兵1 小时前
【BlueZ 】用户态入口:main.c 核心函数与程序启动流程
linux·人工智能·bluez·电脑蓝牙·嵌入式蓝牙
大模型真好玩1 小时前
DeepSeek Harness 入门很简单(一)——认识DeepSeek Harness并安装
人工智能·agent·deepseek
j7~1 小时前
【AI 应用 -- 白话大模型(篇八)】《从零系统学习 AI Skill|起源发展、文件结构、编写原则、机制原理与项目实战案例》
人工智能·skill·编写skill实战·opencode安装·skill社区