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木马人几秒前
9.【AI任务队列实战】如何在高并发下保证系统不崩?(Redis + Celery完整方案)
数据库·人工智能·redis·神经网络·缓存
陈天伟教授7 分钟前
GPT Image 2-桂林山水
人工智能·神经网络·安全·架构
offer收割机小鹅11 分钟前
大学生求职必备:AI面试、AI写作与设计工具助力职场发展
人工智能·ai·面试·aigc·ai写作
乔江seven37 分钟前
【李沐 | 动手学深度学习】20 计算机视觉:数据增广(Data Augmentation)
人工智能·深度学习
冬奇Lab1 小时前
Claude Code 接入 SonarQube 静态扫描:AI 写代码,质量闭环了
人工智能·ai编程·claude
冬奇Lab1 小时前
一天一个开源项目(第84篇):free-claude-code —— 零费用运行 Claude Code 的代理黑魔法
人工智能·开源·claude
泡泡茶壶ᐇ1 小时前
个人网站构建完全指南:从功能规划到技术实现与AI辅助开发
人工智能
cyyt2 小时前
深度学习周报(4.20~4.26)
人工智能·深度学习
Java小生不才2 小时前
spring AI文生图
java·人工智能·spring ai
罗西的思考2 小时前
【OpenClaw】通过 Nanobot 源码学习架构---(10)Heartbeat
人工智能·机器学习