tensorflow 2.1.0:没有属性'random_normal'

问题描述 投票:0回答:2

我正在尝试让Uber的路德维希(Ludwig)跑步。我收到有关没有属性“ random_normal”的错误。我可以使用这些命令在Python中重现该错误。

>>> 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]

非常感谢您帮助我们克服这个错误。

python tensorflow ludwig
2个回答
2
投票

它已移至tf.random.normal(以及所有其他tf.random_*功能)


1
投票

Tensorflow 2.0随附有用于random_normal的新aliases。使用tf.random.normal代替tf.random_normal应该成功执行。

© www.soinside.com 2019 - 2024. All rights reserved.