Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when running tensorflow in virtualenv: module 'tensorflow' has no attribute 'truncated_normal'

I have the following error when running a CNN made in keras

File "venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 4185, in truncated_normal return tf.truncated_normal(shape, mean, stddev, dtype=dtype, seed=seed) AttributeError: module 'tensorflow' has no attribute 'truncated_normal'

I have already installed and reinstalled Tensorflow 2.0 several times. What could be happening?

like image 393
mad Avatar asked Jul 11 '26 17:07

mad


1 Answers

In Tensorflow v2.0 and above, "tf.truncated_normal" replaced with "tf.random.truncated_normal"

like image 94
MERT DOĞAN Avatar answered Jul 14 '26 01:07

MERT DOĞAN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!