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

Traceback (most recent call last):
  File "linear_regression_eager_api.py", line 15, in <module>
    tf.enable_eager_execution()
AttributeError: module 'tensorflow' has no attribute 'enable_eager_execution'

在tensorflow模型训练的遇到这个报错

原因:tensorflow版本太老了,没有'enable_eager_execution'这个属性方法
解决:pip install --upgrade tensorflow更新tensorflow

猜你喜欢

转载自www.cnblogs.com/yizipiaoxiang/p/10496354.html