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

相关推荐
小超同学你好2 分钟前
Transformer 7. Decoder:架构选择、Teacher Forcing 与并行计算
人工智能·语言模型·transformer
Learn Beyond Limits3 分钟前
固定窗口神经语言模型|A fixed-window neural Language Model
人工智能·语言模型·自然语言处理
时光瀚海4 分钟前
跨境旅游出海指南:如何通过国际短信(SMS)精准营销美国华裔银发族?
人工智能·经验分享·旅游·跨境电商·短信营销
来两个炸鸡腿5 分钟前
【Datawhale2603】happy-llm task04 Encoder-Decoder预训练
人工智能·学习·大模型
石工记6 分钟前
OpenClaw AI 助手 Docker Compose 一键部署文档(MacBook Pro 2020 专属版,可下载)
人工智能·docker·容器
Lab_AI10 分钟前
京博控股集团科研管理的智慧创新之道
人工智能·项目管理·电子实验记录本·仪器管理·科研管理·研发数字化
QBoson10 分钟前
量子启发 AI 破解 PDE 难题:QIDNNF 让流体、波动力学模拟更稳更准
人工智能·量子计算·深度神经网络
AaronZZH10 分钟前
规范驱动开发(SDD):AI时代的软件工程新范式
人工智能·驱动开发·软件工程
你好helloworld12 分钟前
claude code安装部署
人工智能
Oscar的参数13 分钟前
在 Windows 上部署 龙虾OpenClaw:基于 WSL2 的详细教程
人工智能·windows·深度学习·ai·语言模型