# Resource Exhausted Error

**URL:** <https://forums.developer.nvidia.com/t/resource-exhausted-error/142980>\
**Category:** Jetson Nano\
**Tags:** tensorflow\
**Created:** [July 21, 2020, 4:47pm UTC](https://forums.developer.nvidia.com/t/resource-exhausted-error/142980 "2020-07-21T16:47:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrsht.sarma](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/hrsht.sarma/32/16549_2.png) [@hrsht.sarma](https://forums.developer.nvidia.com/u/hrsht.sarma)\
**Post date:** [July 21, 2020, 4:47pm UTC](https://forums.developer.nvidia.com/t/resource-exhausted-error/142980/1 "2020-07-21T16:47:01Z")

</div>

I am trying to use FbDeepFace inference using deepface library on jetson nano [deepface · PyPI](https://pypi.org/project/deepface/)

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

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 22, 2020, 3:43am UTC](https://forums.developer.nvidia.com/t/resource-exhausted-error/142980/3 "2020-07-22T03:43:34Z")

</div>

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

```auto
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

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

```

Thanks.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 5:36pm UTC](https://forums.developer.nvidia.com/t/resource-exhausted-error/142980/5 "2021-10-18T17:36:18Z")

</div>

Closed on October 18, 2021, 5:36pm UTC


