TensorFlow创建Session时报AttributeError
时间:2021-05-24 23:11:43
收藏:0
阅读:34
报错内容:
AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘

解决办法:
-
把
tf.Session()
改成tf.compat.v1.Session()
即可解决。 -
版本降级(我这试了不行,降级后还是报错,甚至出现了其他错误)
参考:https://www.jianshu.com/p/f0e8dd1f622e
原文:https://www.cnblogs.com/OFSHK/p/14805515.html
评论(0)