OOM yolo v4 predict ( not train )

my env: Jetson nano, swap 2GB, JetPack 4.4, Tensorflow-1.15.2+nv20.6, Keras 2.3.1.
I run yolov4 for object detection (not train), but exception OOM.
screen log like this:

python invoked oom-killer: gfp_mask=0x240......
Out of memory: Kill process 7926 (python) score 285 or .......
Killed process 7926 (python) total-vm ........

My program is correctly running on x86.
On nano, I have to set value like this:

config.gpu_options.per_process_gpu_memory_fraction = 0.4

What is the reason for the setting above?

Thanks a lot.


The error indicates out of memory.

TensorFlow by default allocates all the available memory when creating session.
Such allocation may fail in the shared memory system, like Jetson.

To limit the available memory for TensorFlow can avoid this issue.

config.gpu_options.per_process_gpu_memory_fraction = 0.4