Skip to content

Object Detection API with TensorFlow 2 Not Training On GPU or Recognizing it  #9724

@hadikoub

Description

@hadikoub

Prerequisites

Please answer the following question for yourself before submitting an issue.

  • I checked to make sure that this issue has not been filed already.

1. The entire URL of the documentation with the issue

https://github.com/tensorflow/models/tree/master/research/object_detection/g3doc/tf2.md

2. Describe the issue

I tried to build the docker image of the tf2 object detection API on my system running ubuntu 16.04 and
the output of

nvidia-smi

Tue Feb  9 21:50:50 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.118.02   Driver Version: 440.118.02   CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:03:00.0 Off |                  N/A |
|  0%   48C    P8    13W / 280W |    145MiB / 11178MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 108...  Off  | 00000000:04:00.0 Off |                  N/A |
| 49%   53C    P8    15W / 280W |    145MiB / 11178MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  GeForce GTX 108...  Off  | 00000000:05:00.0 Off |                  N/A |
| 46%   51C    P8    13W / 280W |    145MiB / 11176MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      4978      C   python3                                      135MiB |
|    1      4978      C   python3                                      135MiB |
|    2      4978      C   python3                                      135MiB |
+-----------------------------------------------------------------------------+

when I run the docker image
docker build -f research/object_detection/dockerfiles/tf2/Dockerfile -t od .
docker run --gpus all -it od
and then I tried to check if the TensorFlow is using GPU with python3

import tensorflow as tf 
assert tf.test.is_gpu_available()

I get this error
AssertionError
and when I tried
tf.config.list_physical_devices('GPU')
I got
[]

So apparently the od tf2 is not using the gpu and I don't know the error

when I tried to run the tensorflow/tensorflow:2.2.0-gpu docker image and tried the same python code It is reading the gpu and using it

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions