Comments (12)
确认下你的ORT有无调用到GPU,你这个速度是没有调用到GPU的速度。
另外ORT调用GPU,第一次运行会比较慢,所以需要启用warm up,另外有一点是,如果你输入每次都是不一样大小的话,那warm up对这种动态效果就不是很好,反而可能更慢,这点python下面会好一些。
from yolov5-seg-opencv-onnxruntime-cpp.
我的输入图像尺寸固定为1440×1080,这个具体要怎么调用GPU啊,大佬可以指点一下不
from yolov5-seg-opencv-onnxruntime-cpp.
from yolov5-seg-opencv-onnxruntime-cpp.
我测试就推理的时间,要接近100多ms, 跟cpu没什么区别,但是是按照你这样的设置了呀? 请问是什么问题呀?
from yolov5-seg-opencv-onnxruntime-cpp.
from yolov5-seg-opencv-onnxruntime-cpp.
@LYHTZHANGJIANG @1404561326521
代码这里设置为true并不代表一定能调用成功,我的策略就是如果启用cuda失败回退带CPU推理。这就是为什么即使你设置了cuda为true,但是仍然和cpu速度一样。
首先请确认下自己的cuda和cudnn是否安装成功,和onnx的版本是否可以匹配,和显卡是否匹配,特别是30系之后的显卡,至少要cuda11.x的版本才行,低于这个版本无法使用cuda。
其次如果会debug,你可以打断点在read模型的时候,看下是否跳转到了 cpu上面去了。如果不会跟代码,就开任务管理器,看下对应的显卡显存有无上涨,引擎修改为cuda看下有无增长。另外,z这里的显卡说的是英伟达的显卡,而非核显或者AMD的显卡
from yolov5-seg-opencv-onnxruntime-cpp.
我就是在任务管理器观察的,运行时cpu占用率提高了很多,gpu的占用率基本没变化
from yolov5-seg-opencv-onnxruntime-cpp.
另外有一点,我再次测试了下我的最新代码,可以成功跑在ort1.9~ort1.16.x,所以请检查一下你自己的环境之类的有无问题,onnxruntime是否下载的gpu版本
from yolov5-seg-opencv-onnxruntime-cpp.
另外有一点,我再次测试了下我的最新代码,可以成功跑在ort1.9~ort1.16.x,所以请检查一下你自己的环境之类的有无问题,onnxruntime是否下载的gpu版本
我的环境是4090 cuda12,ort12.0 是gpu版本,我debug打印看了,是走的cuda,cpu和gpu耗时都是80ms左右,我想问问您那边推理单张图像耗时是多少?
from yolov5-seg-opencv-onnxruntime-cpp.
我的环境是4090 cuda12,ort12.0 是gpu版本,我debug打印看了,是走的cuda,cpu和gpu耗时都是80ms左右,我想问问您那边推理单张图像耗时是多少?
默认640x640的突破的话,前两三张会慢,后面可以达到18-30ms之间(3060,不进行结果绘制,只计算输入图片开始到拿到结果,没有绘制结果),取决于原图大小和上面目标的数量,毕竟计算mask的时候耗时还是比较高的。推理速度的话很快,基本上2-7ms之间,具体没有很详细的计算,大概就是这么个速度。
另外有一点,这个速度是release下面测试的,如果你是debug模式,速度慢是正常的。
from yolov5-seg-opencv-onnxruntime-cpp.
我的环境是4090 cuda12,ort12.0 是gpu版本,我debug打印看了,是走的cuda,cpu和gpu耗时都是80ms左右,我想问问您那边推理单张图像耗时是多少?
默认640x640的突破的话,前两三张会慢,后面可以达到18-30ms之间(3060,不进行结果绘制,只计算输入图片开始到拿到结果,没有绘制结果),取决于原图大小和上面目标的数量,毕竟计算mask的时候耗时还是比较高的。推理速度的话很快,基本上2-7ms之间,具体没有很详细的计算,大概就是这么个速度。 另外有一点,这个速度是release下面测试的,如果你是debug模式,速度慢是正常的。
我的问题解决了,我是环境版本不对应就没能加速,cuda11.6和11.1 ort12是可以的,单跑推理7ms。但是我跑transformer CPU和GPU的耗时还是一样,我观察了显存是变化了的,请问您这边有遇到过吗?
from yolov5-seg-opencv-onnxruntime-cpp.
模型小,或者GPU前面几次推理速度慢,多跑几次取个均值看下
from yolov5-seg-opencv-onnxruntime-cpp.
Related Issues (20)
- 错误字符串 HOT 4
- 请问onnxruntime安装是GPU版本的吗?【目前,我使用onnxruntime-cpu 1.12.0可以解决问题了】 HOT 9
- BUG HOT 3
- 预训练模型加载正常,但自训练模型报错 HOT 2
- 怎么使用? HOT 8
- 请问这种情况是哪地方错误了? HOT 5
- 为什么运行不出现结果 HOT 1
- onnxruntime推理出错 HOT 3
- 引发了异常: 读取访问权限冲突。 **Ort::GetApi**(...) 返回 nullptr。 HOT 2
- 移植问题 HOT 8
- 如何在ubuntu下运行? HOT 2
- undefined reference to `OrtSessionOptionsAppendExecutionProvider_CUDA' HOT 1
- Detect failed! HOT 1
- 运行时间 HOT 1
- mask =mask(temp_rect -Point(left, top)) > mask_threshold;请问这句话是什么意思?我总是在这里报错 HOT 8
- GPU推理内存占用过大 HOT 3
- c++推理结果与python推理结果不一致问题 HOT 16
- 代码崩溃: HOT 18
- Does this software work in a Ubuntu 18.04 machine without GPU? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5-seg-opencv-onnxruntime-cpp.