'Mask RCNN using tensorflow 1.14.0 takes the same time to train using CPU and GPU

I'm a student trying to use the Mask RCNN code from here:

https://machinelearningmastery.com/how-to-train-an-object-detection-model-with-keras/#comment-669447

and it works completly fine when running on CPU. I'm trying to use my universitys GPU and have run into the following problem: when running the TrainMaskRCNNModel on GPU or on CPU it takes the same time to run each epoch. because I wanted to first check if it even runs on GPU, I am now training it only over 4 sample images, and the first epoch takes around 10 min both times (GPU or CPU). this is also after I have lowered the IMAGES_PER_BATCH to 1, because I understood that sometimes the batch size is whats making the calculations take too much time using GPU. I have added :

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

in the beginning of the Train code to check that tensorflow is able to detect my GPU devices and it seems that it is :)

I am using tensorflow 1.14.0, CUDA 10.0, and cuDNN 7.6.2, as the code I am using from the site above does not work on tensorflow 2+.

does anybody have any idea why the code takes exactly the same time running on GPU and on CPU? and what can I do to improve that? thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source