I am getting a resource exauhsted error when initiation training for my object detection Tensorflow 2.5 GPU model. I am using 18 training images and 3 test images. The pre-trained model I am using is the Faster R-CNN ResNet101 V1 640x640 model from Tensorflow zoo 2.2. I am using a Nvidia RTX 2070 with 8 GB dedicated memory to train my model.
The thing I am confused about is why the training process is taking up so much memory from my GPU when the training set is so small. This is the summary of GPU memory I get along with the error:
Limit: 6269894656
InUse: 6103403264
MaxInUse: 6154866944
NumAllocs: 4276
MaxAllocSize: 5786902272
Reserved: 0
PeakReserved: 0
LargestFreeBlock: 0
I also decreased the batch size of the training data to 6, and of the testing data to 1.