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

相关推荐
魔术师Grace11 分钟前
从传统企业架构到 OPC 模式,AI 到底改变了什么?
人工智能·程序员
沪漂阿龙12 分钟前
LangGraph 持久化完全指南:从零搭建永不丢失状态的 AI Agent 系统
人工智能·流程图
杨浦老苏12 分钟前
大模型安全接入网关LinkAI
人工智能·docker·ai·群晖·隐私保护
档案宝档案管理13 分钟前
权限分级管控,全程可追溯,筑牢会计档案安全防线
运维·网络·人工智能
Chat_zhanggong34514 分钟前
主推RK3567J作用有哪些?
人工智能·嵌入式硬件
qq_4112624224 分钟前
四博 AI 机械臂台灯智能音箱方案:让台灯具备视觉、语音、动作和学习陪伴能力
人工智能·语音识别
AI+程序员在路上36 分钟前
VS Code 完全使用指南:下载、安装、核心功能与 内置AI 编程助手实战
开发语言·人工智能·windows·开源
coderyi1 小时前
Agent协作简析
人工智能
霍小毛1 小时前
破局工业数据孤岛!数字孪生+AI智慧设备资产管理平台,重构智能运维新范式
人工智能·重构
AI人工智能+1 小时前
基于深度学习的银行回单识别技术,成为连接物理票据与数字财务系统的桥梁
深度学习·计算机视觉·ocr·银行回单识别