解决:tensorflow have no attribute enable_eager_execution()

具体写法根据tensorflow的版本而定


# tensorflow >= 1.5
tf.compat.v1.enable_eager_execution() 
 
# tensorflow >= 1.4 <2.0
tf.enable_eager_execution() 
 
# tensorflow >= 2.0
以上都免了,也可以使用第一个

你可能感兴趣的:(解决:tensorflow have no attribute enable_eager_execution())