[Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘

Recently, I was watching Mo fan’s PPO code running problems

norm_dist = tf.distributions.Normal(loc=mu, scale=sigma)

report errors:

AttributeError: module 'tensorflow' has no attribute 'distributions'

TF. Distributions is one of the core components provided by tensorflow. It is used to implement some common probability distributions and gives a series of auxiliary calculation functions.

The reason for the problem:
I didn’t look carefully. Mo fan’s version of TensorFlow is TensorFlow r1.3
his version is too old. It’s better to upgrade 1.2.0 to the same version
pay attention to the version of the code in the future

Read More: