Error indicating GPU

This is my code

from imageai.Detection.Custom import DetectionModelTrainer
trainer = DetectionModelTrainer()
trainer.setModelTypeAsYOLOv3()

trainer.setDataDirectory(data_directory='C:\\Users\\user\\Desktop\\ImageAI Detection')
trainer.setTrainConfig(object_names_array=['TNB label','Streetlight'],batch_size=4, num_experiments=50, train_from_pretrained_model='pretrained-yolov3.h5')
trainer.setGpuUsage([0])
trainer.trainModel()

And this is my error

ResourceExhaustedError: 2 root error(s) found.
(0) Resource exhausted: OOM when allocating tensor with shape[4,104,104,128] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node bnorm_7_1/cond/Merge-0-0-TransposeNCHWToNHWC-LayoutOptimizer}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

 [[loss_1/Identity/_7707]]

Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

(1) Resource exhausted: OOM when allocating tensor with shape[4,104,104,128] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node bnorm_7_1/cond/Merge-0-0-TransposeNCHWToNHWC-LayoutOptimizer}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

0 successful operations.
0 derived errors ignored.

@aqiff12 You are experiencing this issue because your GPU memory cannot process the training batch_size of 4. Change the value to 2 and attempt the experiment again.