Windows 上带有 GPU 的 Tensorflow 对象检测 API 和实时检测 [英] Tensorflow Object Detection API with GPU on Windows and real-time detection

查看:100
本文介绍了Windows 上带有 GPU 的 Tensorflow 对象检测 API 和实时检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Python 中测试新的 Tensorflow 对象检测 API,并且我成功地使用 docker 在 Windows 上安装了它.然而,我的训练模型(Faster RCNN resnet101 COCO)做出预测最多需要 15 秒(虽然准确度非常好),可能是因为我只使用 Tensorflow CPU.

I am testing the new Tensorflow Object Detection API in Python, and I succeeded in installing it on Windows using docker. However, my trained model (Faster RCNN resnet101 COCO) takes up to 15 seconds to make a prediction (with very good accuracy though), probably because I only use Tensorflow CPU.

我的三个问题是:

  • 考虑到延迟,问题出在哪里?我听说 Faster RCNN 是一个很好的低延迟视觉检测模型,是因为只执行 CPU 吗?
  • 在这样的延迟下,是否可以使用 tensorflow GPU 进行高效的实时视频处理,还是应该使用更流行的模型,如 YOLO?
  • 在 docker 中使用 tensorflow GPU 的流行方法是 nvidia-docker,但在 Windows 上不受支持.我应该继续寻找用于本地预测的 docker(或 conda)解决方案,还是应该将我的模型直接部署到具有 GPU 的虚拟实例(我对 Google Cloud Platform 很满意)?

非常欢迎任何有关使用 Tensorflow 进行实时视频处理的建议和/或良好做法!

Any advice and/or good practice concerning real-time video processing with Tensorflow is very welcome!

推荐答案

考虑到延迟,问题出在哪里?我听说更快的 RCNN是低延迟视觉检测的好模型,是因为仅 CPU 执行?

Considering the latency, where is the problem ? I heard Faster RCNN was a good model for low latency visual detection, is it because of the CPU-only execution ?

当然是因为你在使用 CPU.

Of course, it's because you are using CPU.

有这样的延迟,是否有可能制作高效的实时视频使用 tensorflow GPU 进行处理,还是应该使用更流行的像YOLO这样的模型?

With such latency, is it possible to make efficient realtime video processing by using tensorflow GPU, or should I use a more popular model like YOLO ?

Yolo 速度很快,但我曾经用它来打脸,而且准确性不是很好.但一个不错的选择.

Yolo is fast, but I once used it for face and accuracy was not that great. But a good alternative.

在 docker 中使用 tensorflow GPU 的流行方法是 nvidia-docker 但是在 Windows 上不支持.我应该继续寻找码头工人吗(或 conda)本地预测解决方案,或者我应该部署我的模型直接到带有 GPU 的虚拟实例(我对 Google 很满意云平台)?

The popular mean to use tensorflow GPU in docker is nvidia-docker but is not supported on windows. Should I continue to look for a docker (or conda) solution for local prediction, or should I deploy my model directly to a virtual instance with GPU (I am comfortable with Google Cloud Platform) ?

我认为您仍然可以在 Windows 中使用本地 GPU,因为 Tensorflow 支持 Python 上的 GPU.

I think you can still use your local GPU in windows, as Tensorflow supports GPU on python.

这里是一个例子,只是为了做到这一点.它有一个可以读取网络摄像头或 IP 摄像头流的客户端.服务器正在使用 Tensorflow python GPU 版本并准备使用预训练模型进行预测.

And here is an example, simply to do that. It has a client which can read webcam or IP cam stream. The server is using Tensorflow python GPU version and ready to use pre-trained model for predictions.

遗憾的是,Tensoflow 在 Windows 上不支持 tensorflow-serving.同样如您所说,Windows 不支持 Nvidia-Docker.Windows 上的 Bash 也不支持 GPU.所以我认为这是目前唯一简单的方法.

Unfortunately, Tensoflow does not support tensorflow-serving on windows. Also as you said Nvidia-Docker is not supported on windows. Bash on windows has no support for GPU either. So I think this is the only easy way to go for now.

这篇关于Windows 上带有 GPU 的 Tensorflow 对象检测 API 和实时检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆