module 'tensorflow' has no attribute 'InteractiveSession的解决方法

JiaMian8291 2017-07-28 09:55:58
代码里面有这么一句:sess = tf.InteractiveSession()
运行的时候提示: module 'tensorflow' has no attribute 'InteractiveSession'
使用ide是anaconda里的spyder,python版本3.5
InteractiveSession不是自带的接口么,为什么会报错呀?
...全文
5073 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dragon水魅 2021-07-13
  • 打赏
  • 举报
回复

一楼正确答案

丶子麒 2020-12-01
  • 打赏
  • 举报
回复 9
import tensorflow as tf 替换为: import tensorflow.compat.v1 as tf tf.disable_v2_behavior()
bibiANDkiki 2019-12-06
  • 打赏
  • 举报
回复 2
使用 sess = tf.compat.v1.InteractiveSession()

37,719

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧