GKozinski
GKozinski

Reputation: 145

Object detection slow and does not use GPU

I need to use Tensorflow Object Detection API to make some classification connected with recognition.

My problem is that using the API for detection with a pretrained coco model takes too much time and for sure does not use the GPU. I checked my tensorflow-gpu installation on different scripts and it works fine, but when I use this model for detection I can only see increse in CPU usage.

I checked different version of tensorflow (1.12, 1.14), different combinations of CUDA Toolkit (9.0, 10.0) and CuDNN (7.4.2, 7.5.1, 7.6.1) but it is all the same, also tried it on both Windows 7 and Ubuntu 16.04, no difference. My project however requires much faster detection time.

System information: System: Windows 7, Ubuntu 16.04 Tensorflow: 1.12, 1.14 GPU: GTX 970

Upvotes: 0

Views: 2199

Answers (1)

Pranit Kothari
Pranit Kothari

Reputation: 9841

Run following python code, if it detects GPU then you can use GPU for training otherwise there is some problem,

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

One more thing, just because your CPU is utilizing does not mean GPU is not at work. CPU always be busy, GPU should also spike when you are training.

Paste the output of above code in the comment if you are not sure about the output.

Edit: After chat with OP on comments, I see the suggested code, and it is using pretrained model, so no training happening here. You are using model and not training a new model. So no gpu is being used.

Upvotes: 2

Related Questions