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知识权威构建:北京鲲鹏伟业的GEO赋能之道——GEO公司助力企业数字化转型
人工智能
阿湯哥7 分钟前
Workflow or Agent+Skill:AI 工作流的进化抉择
人工智能
阿坤带你走近大数据12 分钟前
如何解决农业数据的碎片化问题
大数据·人工智能·rag·大模型应用
Modeler·X14 分钟前
关系型与非关系型数据库终极对决
数据库·人工智能
颜淡慕潇16 分钟前
动态代理赋能:高效爬取沃尔玛海量商品信息与AI分析实战
人工智能·后端
LOnghas121138 分钟前
长须鲸目标检测_YOLO13-C3k2-OREPA改进方案实战
人工智能·目标检测·计算机视觉
Hcoco_me1 小时前
大模型面试题75:讲解一下GRPO的数据回放
人工智能·深度学习·算法·机器学习·vllm
赫尔·普莱蒂科萨·帕塔1 小时前
“共享”机器人
人工智能·机器人·agi
duyinbi75171 小时前
改进YOLO13模型:C3k2与PPA优化在油田工人安全装备检测与行为识别中的应用
人工智能·安全·目标跟踪
Duang007_1 小时前
【LeetCodeHot100 超详细Agent启发版本】两数之和 (Two Sum)
java·人工智能·python