简体   繁体   English

Windows上具有GPU的Tensorflow对象检测API和实时检测

[英]Tensorflow Object Detection API with GPU on Windows and real-time detection

I am testing the new Tensorflow Object Detection API in Python, and I succeeded in installing it on Windows using docker. 我正在用Python测试新的Tensorflow对象检测API ,并成功使用docker在Windows上安装了它。 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 resnet101 COCO) 最多需要15秒才能做出预测 (尽管准确性很高),可能是因为我仅使用Tensorflow CPU。

My three questions are: 我的三个问题是:

  • 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? 我听说Faster RCNN是低延迟视觉检测的良好模型,是因为仅CPU执行吗?
  • 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? 有了这样的延迟,是否可以通过使用Tensorflow GPU进行高效的实时视频处理,还是我应该使用更流行的模型,例如YOLO?
  • The popular mean to use tensorflow GPU in docker is nvidia-docker but is not supported on windows. 在docker中使用tensorflow GPU的流行方法是nvidia-docker,但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)? 我应该继续寻找用于本地预测的docker(或conda)解决方案,还是应该将模型直接部署到具有GPU的虚拟实例(我对Google Cloud Platform感到满意)?

Any advice and/or good practice concerning real-time video processing with Tensorflow is very welcome! 非常欢迎有关使用Tensorflow进行实时视频处理的任何建议和/或良好实践!

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 ? 我听说Faster RCNN是低延迟视觉检测的好模型,是因为仅CPU执行吗?

Of course, it's because you are using CPU. 当然,这是因为您正在使用CPU。

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 ? 有了这样的延迟,是否可以通过使用Tensorflow GPU进行高效的实时视频处理,还是我应该使用更流行的模型如YOLO?

Yolo is fast, but I once used it for face and accuracy was not that great. Yolo很快,但我曾经将它用于面部,准确性也不是很好。 But a good alternative. 但是是一个很好的选择。

The popular mean to use tensorflow GPU in docker is nvidia-docker but is not supported on windows. 在docker中使用tensorflow GPU的流行方法是nvidia-docker,但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) ? 我应该继续寻找用于本地预测的docker(或conda)解决方案,还是应该将模型直接部署到具有GPU的虚拟实例(我对Google Cloud Platform感到满意)?

I think you can still use your local GPU in windows, as Tensorflow supports GPU on python. 我认为您仍然可以在Windows中使用本地GPU,因为Tensorflow在python上支持GPU。

And here is an example, simply to do that. 是一个示例,只需执行此操作即可。 It has a client which can read webcam or IP cam stream. 它具有可以读取网络摄像头或IP凸轮流的客户端。 The server is using Tensorflow python GPU version and ready to use pre-trained model for predictions. 该服务器正在使用Tensorflow python GPU版本,并准备使用预先训练的模型进行预测。

Unfortunately, Tensoflow does not support tensorflow-serving on windows. 不幸的是,Tensoflow不支持tensorflow-serving上的tensorflow-serving Also as you said Nvidia-Docker is not supported on windows. 就像您所说的那样,Windows不支持Nvidia-Docker Bash on windows has no support for GPU either. Bash on windows上的Bash on windows也不支持GPU。 So I think this is the only easy way to go for now. 因此,我认为这是目前唯一的简便方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM