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假装科研4 分钟前
即插即用模块(3) -LSK 特征提取
人工智能·深度学习·计算机视觉
愚昧之山绝望之谷开悟之坡9 分钟前
什么是视频上墙
人工智能·笔记
pljnb17 分钟前
SVM(支持向量机)
人工智能·机器学习·支持向量机
掘金詹姆斯18 分钟前
LangChain4j—持久化聊天记忆 Persistence(五)
java·人工智能
梓羽玩Python29 分钟前
开源AI代理爆火!Suna:3天内新增5.5K+标星,自然对话驱动的自动化神器!
人工智能·python·github
新智元34 分钟前
70% 大小,100% 准确!完美压缩 LLM 性能 0 损失,推理速度最高飙升 39 倍
人工智能·openai
Ann36 分钟前
RAG:让AI回答更“靠谱”
人工智能·llm
新智元39 分钟前
GPT-4.5 功臣遭驱逐!奥特曼盛赞工作出色,美国深陷 AI 人才危机
人工智能·openai
带娃的IT创业者1 小时前
《AI大模型趣味实战》智能Agent和MCP协议的应用实例:搭建一个能阅读DOC文件并实时显示润色改写过程的Python Flask应用
人工智能·python·flask
一只韩非子1 小时前
什么是MCP?为什么引入MCP?(通俗易懂版)
人工智能·aigc·mcp