![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度学习
alongwaywith
这个作者很懒,什么都没留下…
展开
-
解决 RuntimeError: The Session graph is empty. Add operations to the graph before calling run().
这个是因为 tensorflow的版本问题,你用的应该是2.几的版本。但是看的可能是1.几的教程。由于之前调用过的图,现在图不为空,没办法重新再执行一次。简单说缺少一个处理 清理开始的会话或者图的代码。使其为空。可以考虑引入keras清除也可以在代码加上f.compat.v1.disable_eager_execution()即可...原创 2021-04-11 17:26:01 · 2144 阅读 · 0 评论 -
解决 AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘
学习tensorflow的时候遇到这个问题了原因很简单:因为在新的Tensorflow 2.0版本中已经移除了Session这一模块。可以选择下版本较低的Tensorflow也可以选择 修改成 tf.compat.v1.Session()原创 2021-04-11 17:12:33 · 3055 阅读 · 1 评论