简体   繁体   English

在 GPU(而不是 CPU)上运行 object 检测算法时出现问题

[英]Problem with run object detect algorithm on GPU (instead of CPU)

I try to run algorithm from this guy: https://github.com/theAIGuysCode/Object-Detection-API我尝试从这个人那里运行算法: https://github.com/theAIGuysCode/Object-Detection-API

I download all requirements and algorithm run BUT only on CPU I guess.我下载了所有要求和算法,但我猜只在 CPU 上运行。 I get just up to 2,5 FPS (that's why I think that run on CPU not GPU) and that not the real-time I need.我只得到了 2,5 FPS(这就是为什么我认为它在 CPU 而不是 GPU 上运行),这不是我需要的实时性。 I don't how to "force" Python to run this on GPU to get at least 10 FPS.我不会如何“强制”Python 在 GPU 上运行它以获得至少 10 FPS。 I tried different versions of tensorflow and CUDA and that didn't help.我尝试了不同版本的 tensorflow 和 CUDA 并没有帮助。 Did anybody have the same problem with this algorithm or have any idea how to fix this?有人对这个算法有同样的问题,或者知道如何解决这个问题吗? I tried run this even on 2 different PCs and I got the same situation.我什至尝试在 2 台不同的 PC 上运行它,但我遇到了同样的情况。 On Linux (Mint 20) and Windows (10) also have the same result.在 Linux (Mint 20) 和 Windows (10) 上也有相同的结果。

I work on Dell Inspiron 17 and graphic card is: Nvidia GeForce 940MX我在 Dell Inspiron 17 上工作,显卡是: Nvidia GeForce 940MX

CUDA Version: 10.1 CUDA 版本:10.1

Tensorflow-gpu==2.1.0 TensorFlow-gpu==2.1.0

Run the code below to see if the GPU is detected by tensorflow.运行下面的代码,看看tensorflow是否检测到GPU。 If Number of GPU =0 it is not detecting it.如果 GPU 的数量 =0 则未检测到它。 In that case if you have Anaconda installed I would reinstall tensorflow using Conda.在这种情况下,如果您安装了 Anaconda,我将使用 Conda 重新安装 tensorflow。 Conda will install tensorflow and the Cuda Toolkit and Cudnn. Conda 将安装 tensorflow 和 Cuda 工具包和 Cudnn。 Pip does not install those two items and without them tensorflow will not use the GPU Pip 不安装这两个项目,没有它们 tensorflow 将不会使用 GPU

import tensorflow as tf
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
print(tf.__version__)
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
tf.test.is_gpu_available()
!python --version

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

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