使用tensorflow中Session模块时报错:AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘
使用tensorflow中Session模块时报错:AttributeError: module 'tensorflow' has no attribute 'Session'
报错AttributeError: module ‘tensorflow’ has no attribute ‘Session’。这是因为在Tensorflow 2.0版本中已经移除了Session这一模块,并不是安装错误。
两种解决方法
法1.
在程序开头部分添加
tf.compat.v1.disable_eager_execut
原创
2020-10-19 14:42:16 ·
233 阅读 ·
0 评论