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

相关推荐
198******126345 小时前
2026深度解读:Work Agent长程任务的技术机制与落地能力
人工智能
老金带你玩AI5 小时前
别只让AI解释,让它做个你能看懂的东西
人工智能
iffy15 小时前
Deepseek hardness 桌面版 + ollama
人工智能
Xiaofeng36935 小时前
知漫剧入门科普:一站式工作台一句话生成漫剧
人工智能
“AI国潮设计-小江”6 小时前
《Python+SDXL实战:用ControlNet精准控制“英歌舞翻糖吐司”构图,附批量生成脚本》
开发语言·人工智能·python·prompt·aigc
MobotStone6 小时前
万物皆插件:DeepSeek Harness 底层揭秘,脚手架如何蜕变为产品
人工智能
youdexiang6 小时前
Android录音软件时间关键词检索功能分析
java·人工智能
WUYOUGYLU7 小时前
大模型时代:人与智能的共同进化
人工智能
netkiller-BG7NYT7 小时前
基于图像识别的人工智能中医望诊方案
人工智能·百度
W***25927 小时前
Work Agent深度解读:AI长程任务的执行机制与落地形态
人工智能