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

相关推荐
水如烟4 分钟前
孤能子视角:EIS看宇宙创生寂灭假说——人类宇宙学假说的操作描述重显影
人工智能
Elastic 中国社区官方博客8 分钟前
从建议到修复的 4 个阶段:使用 Elastic Workflows 实现人在回路中的自动化
运维·数据库·人工智能·后端·elasticsearch·ai·自动化
码视野10 分钟前
基于 Spring Boot + Vue3 的【城市地下燃气管网微泄漏感知与相邻地下空间燃爆预警中台】设计与实现(含PRD/三端高保真源码/大屏)
java·前端·人工智能·spring boot·后端
土星云SaturnCloud15 分钟前
大型仓储AI视觉全场景落地实战:安全·效率·库存,32TOPS土星云边缘算力赋能分区部署
服务器·人工智能·ai·边缘计算
智塑未来15 分钟前
2026年边缘计算网关哪个品牌好?多厂商边缘算力能力横评
人工智能·边缘计算
ShallWeL34 分钟前
【Agent工程】(6)—— 危险写操作与二次确认
人工智能·agent·工作流·智能体
具身AGI38 分钟前
基座模型架构之争,物理AI 人类学习路线 的双脑答案
人工智能·学习·架构
DeepIntelli39 分钟前
GEO服务、传统网页优化与AI问答引流的区别:从工程视角看三者的目标、链路与验收方式
人工智能
SmartBrain40 分钟前
以史为鉴,对AI时代企业数字化转型的启示
人工智能·架构·创业创新
阿宁学科技术库44 分钟前
关于“库库AI”在股票投研场景实用性的技术观察
大数据·人工智能·职场和发展