Resource Exhausted Error

I am trying to use FbDeepFace inference using deepface library on jetson nano deepface · PyPI

However I dont think it takes more than 1 GB memory to load , but somehow I am getting OOM on my nano :
in step: model = FbDeepFace.loadModel()
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[3025,1296,16] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc

Hi,

Could you try to set some limitation on the TensorFlow memory usage to see if helps first?

1. Limit the maximal memory available for TensorFlow

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.6)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))

2. Allow gradually memory allocation

config = tf.ConfigProto()
config.gpu_options.allow_growth=True
sess = tf.Session(config=config)

Thanks.

1 Like