tensorflow 2.1.0: has no attribute 'random_normal'
Question:
I’m trying to get Uber’s Ludwig to run. I get an error about there being no attribute ‘random_normal’. I can reproduce the error in Python with these commands.
>>> import tensorflow as tf
>>> tf.reduce_sum(tf.random_normal([1000,1000]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'random_normal'
>>> print(tf.__version__)
2.1.0
>>> print(sys.version)
3.7.5 (defaut, Oct 25 2019, 15:51:11)
[GCC 7.3.0]
Would appreciate help re how to get past this error.
Answers:
It was moved to tf.random.normal
(along with all the other tf.random_*
functions)
Tensorflow 2.0 comes with new aliases for random_normal. Using tf.random.normal
instead of tf.random_normal
should execute successfully.
Use this method.
tf.reduce_sum(tf.compat.v1.random_normal([1000,1000]))
I’m trying to get Uber’s Ludwig to run. I get an error about there being no attribute ‘random_normal’. I can reproduce the error in Python with these commands.
>>> import tensorflow as tf
>>> tf.reduce_sum(tf.random_normal([1000,1000]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'random_normal'
>>> print(tf.__version__)
2.1.0
>>> print(sys.version)
3.7.5 (defaut, Oct 25 2019, 15:51:11)
[GCC 7.3.0]
Would appreciate help re how to get past this error.
It was moved to tf.random.normal
(along with all the other tf.random_*
functions)
Tensorflow 2.0 comes with new aliases for random_normal. Using tf.random.normal
instead of tf.random_normal
should execute successfully.
Use this method.
tf.reduce_sum(tf.compat.v1.random_normal([1000,1000]))