AttributeError: module ‘tensorflow’ has no attribute ‘set_random_seed’ 解决方案:tensorflow2.0将set_random_seed改成了tf.random.set_seed()
AttributeError: module ‘tensorflow’ has no attribute 'placeholder 解决方案:版本问题,强制使用tensorflow1.0 import tensorflow.compat.v1 as tf tf.disable_v2_behavior()
tensorflow 2.1.0: has no attribute ‘random_normal’ 解决方案:改成了tf.random.normal
module ‘tensorflow’ has no attribute ‘variable_scope’ 解决方案:Replace “tf.variable_scope” with “tf.compat.v1.variable_scope”