Python
feijianxiaolin
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
tensorflow2 AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘
转载链接:https://blog.youkuaiyun.com/qq_40575024/article/details/105862550 收起 出现问题: AttributeError: module ‘tensorflow’ has no attribute ‘Session’ 原因: tensorflow2删除了 tf.Session() 解决方法: tf.Session() 将改为tf.compat.v1.Session() 或者版本降级:pip install tensorflow==1.4转载 2020-12-14 16:58:59 · 236 阅读 · 0 评论 -
RuntimeError: The Session graph is empty. Add operations to the graph before calling run().解决方法
问题产生的原因:无法执行sess.run()的原因是tensorflow版本不同导致的,tensorflow版本2.0无法兼容版本1.0. 解决办法: tf.compat.v1.disable_eager_execution() import tensorflow as tf tf.compat.v1.disable_eager_execution() #保证sess.run()能够正常运行 hello = tf.constant('hello,tensorflow') sess= tf.compat.转载 2020-12-14 16:57:17 · 1828 阅读 · 0 评论
分享