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

相关推荐
浩风祭月几秒前
GPT-6 Astra API怎么接?Responses API迁移、异步工具调用与兼容项清单
人工智能·chatgpt·大模型·openai api·gpt-6 astra
FPC工厂——皇榜科技2 分钟前
FPC拼板的利用率怎么算?排版方式不同,材料成本差15%
人工智能·科技·pcb工艺
Raspberry_Pi_官方账号12 分钟前
Raspberry Pi+TinyML:基于边缘计算的低成本离线皮肤癌AI诊断系统
人工智能·边缘计算·树莓派·raspberry pi·tinyml
阿里云大数据AI技术17 分钟前
闲鱼「鱼卖卖」的长期记忆实践:用阿里云 Milvus 记住卖家的经营偏好
人工智能·agent
疯神NB18 分钟前
循环神经网络RNN
人工智能·rnn·深度学习
bdy_y919 分钟前
推理引擎测试指南:像调校赛车一样测试AI引擎
人工智能·大模型·性能测试
艾络迅Acceleronix27 分钟前
从连接到落地|移远艾络迅携手NAXEON构建电摩智能化能力
人工智能
尺度商业29 分钟前
摩尔线程迎来解禁:谁在割肉,谁在捡筹?
人工智能
月华路32 分钟前
《模型不玄学》第24章 第二个标签怎么造:层级标签
人工智能·深度学习·机器学习
咖啡星人k34 分钟前
2026 上下文缓存进阶:把前缀契约写进SPEC,MonkeyCode 云端跑通
人工智能·机器学习·缓存