TensorFlow创建Session时报AttributeError

时间:2021-05-24 23:11:43   收藏:0   阅读:34

报错内容:

AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘

技术分享图片

解决办法:

  1. tf.Session() 改成 tf.compat.v1.Session() 即可解决。

  2. 版本降级(我这试了不行,降级后还是报错,甚至出现了其他错误)

参考:https://www.jianshu.com/p/f0e8dd1f622e

原文:https://www.cnblogs.com/OFSHK/p/14805515.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!