# I can't run tf.random.normal(\[1000, 1000\])

**URL:** <https://discuss.ai.google.dev/t/i-cant-run-tf-random-normal-1000-1000/27087>\
**Category:** General Discussion\
**Tags:** python, tensorflow\
**Created:** [April 25, 2024, 5:24am UTC](https://discuss.ai.google.dev/t/i-cant-run-tf-random-normal-1000-1000/27087 "2024-04-25T05:24:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![itoy827](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/itoy827/32/7865_2.png) [@itoy827](https://discuss.ai.google.dev/u/itoy827)\
**Post date:** [April 25, 2024, 5:24am UTC](https://discuss.ai.google.dev/t/i-cant-run-tf-random-normal-1000-1000/27087/1 "2024-04-25T05:24:54Z")

</div>

When I run the following code :

```auto
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
from flask import Flask, jsonify
import numpy as np
import tensorflow as tf

app = Flask( __name__ )

@app.route('/', methods=['GET'])
def sum_random():
    result = tf.reduce_sum(tf.random.normal([1000, 1000]))
    return jsonify({'result': result.numpy()})

if __name__ == ' __main__':
    app.run(debug=True)

```

I got the following error message:  
2024-04-25 10:52:25.965625: F external/local\_tsl/tsl/platform/default/env.cc:74] Check failed: ret == 0 (11 vs. 0)Thread tf\_numa\_-1\_Eigen creation via pthread\_create() failed.  
[UID:1484][2325686] Child process with pid: 2327985 was killed by signal: 6, core dumped: yes  
2024-04-25 10:52:26.396146: F external/local\_tsl/tsl/platform/default/env.cc:74] Check failed: ret == 0 (11 vs. 0)Thread tf\_numa\_-1\_Eigen creation via pthread\_create() failed.  
[UID:1484][2325686] Child process with pid: 2328392 was killed by signal: 6, core dumped: yes  
2024-04-25 10:52:26.786404: F external/local\_tsl/tsl/platform/default/env.cc:74] Check failed: ret == 0 (11 vs. 0)Thread tf\_numa\_-1\_Eigen creation via pthread\_create() failed.  
[UID:1484][2325686] Child process with pid: 2328774 was killed by signal: 6, core dumped: yes

The following is my specification:  
Python 3.11.8  
Tensorflow 2.16.1  
Flask 3.0.3  
Numpy 1.26.4

How do i resolve this issue ?

---

<div class="post-metadata">

**Author:** ![Kiran\_Sai\_Ramineni](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/kiran_sai_ramineni/32/8859_2.png) [@Kiran\_Sai\_Ramineni](https://discuss.ai.google.dev/u/Kiran_Sai_Ramineni)\
**Post date:** [May 10, 2024, 6:02am UTC](https://discuss.ai.google.dev/t/i-cant-run-tf-random-normal-1000-1000/27087/3 "2024-05-10T06:02:42Z")

</div>

Hi @itoy827, I suspect that this error might be caused due to the memory constraint. Could you please try with the lesser shape while defining the tf.random.normal. Thank You
