#AttributeError: module ‘tensorflow.python.ops.nn’ has no attribute ‘leaky_relu’ 的原因主要是版本的问题

解决方法是更新到对应的版本:

keras 2.1.5

tensorflow-gpu 1.2.1

更新的操作如下(使用国内镜像):

pip install keras==2.1.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

pip install tensorflow-gpu==1.2.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

搞定~~

AttributeError: module ‘tensorflow.python.ops.nn’ has no attribute ‘leaky_relu’的更多相关文章

  1. 启动Tensorboard时发生错误:class BeholderHook(tf.estimator.SessionRunHook): AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'SessionRunHook'

    报错:class BeholderHook(tf.estimator.SessionRunHook):AttributeError: module 'tensorflow.python.estimat ...

  2. 成功解决 AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

    在导入keras包时出现这个问题,是因为安装的tensorflow版本和keras版本不匹配,只需卸载keras,重新安装自己tensorflow对应的版本就OK了.可以在这个网址查看tensorfl ...

  3. AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'处理办法

    原因:安装的tensorflow版本和keras版本不匹配,只需卸载keras,重新安装自己tensorflow对应的版本. Keras与tensorflow版本匹配查询网站  

  4. AttributeError: module 'tensorflow' has no attribute 'enable_eager_execution'

    Traceback (most recent call last): File "linear_regression_eager_api.py", line 15, in < ...

  5. AttributeError: module 'tensorflow' has no attribute 'sub'

    官方的例子:运行之后出现以下错误 # 进入一个交互式 TensorFlow 会话. import tensorflow as tf sess = tf.InteractiveSession() x = ...

  6. AttributeError: module 'tensorflow' has no attribute 'Session'

      版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/qq_33440324/article/ ...

  7. AttributeError: module 'selenium.webdriver.common.service' has no attribute 'Service'

    今天爬虫时需要使用到selenium, 使用pip install selenium进行安装. 可是一开始写程序就遇到了AttributeError: module 'selenium.webdriv ...

  8. 关于moviepy打包报错AttributeError: module audio/video.fx.all has no attribute fadein、crop文章的纠错和抄袭

    专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 老猿学5G博文目录 老猿前面有篇文章<moviepy应用pyin ...

  9. moviepy应用pyinstaller打包后执行报错AttributeError: module audio/video.fx.all has no attribute fadein、crop

    专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 在开发moviepy的Python程序使用pyinstaller打包后 ...

随机推荐

  1. java_继承、实现、依赖、关联、聚合、组合的代码表示

    一.继承.实现.依赖.关联.聚合.组合的简单代码表示 1.继承关系 1).文字描述 一个类或者接口继承了另一个类或者接口,增加了在原有的方法和属性上增加了新的方法和属性. 2).代码表示 class ...

  2. 学习scalaenv

    背景 最近由于工作需要, 我总是在不同的scala项目间流动开发. 这就遇到一个很棘手的问题, 这几个项目用的scala版本不一致, 老项目用的是 scala 2.11.8, 新项目用的是 scala ...

  3. struts2第二天——数据操作

    先介绍一下大致内容: 大致内容: 结果页面配置 action获取表单提交数据 提供获取表单数据的方式(封装数据) 表单数据封装到集合中 表达式封装和模型驱动封装比较 一.结果页面配置: result标 ...

  4. python列表,元组,字典和字符串之间的相互转换

    元组转换成列表 >>> mytuple = (1,2,3) >>> print list(mytuple) [1, 2, 3] 列表转换成元组 >>&g ...

  5. flex“深拷贝”

    以前在<ActionScript殿堂之路>上就看到过的“深拷贝”概念一直没有好好地在实战中用到过,但是最近在开发过程中,我发现我在编写VO数据对象时的一个老习惯很浪费我的编码时间,这个习惯 ...

  6. 20145234黄斐《网络对抗技术》实验九、Web安全基础实践

    PS:我是分了两次做的这次试验,第二次实验的时候电脑出了一点问题熄火了……原本后面的是有图的结果博客没保存图没了…… WebGoat WebGoat是由著名的OWASP负责维护的一个漏洞百出的J2EE ...

  7. cogs468 [NOI2010]超级钢琴

    http://cogs.pro:8080/cogs/problem/problem.php?pid=468 emmmmmm 今天考试爆炸顺便切了这题 这题我肯定不会啦然后看一sol.. 固定一个右端点 ...

  8. 解决 sr 的端口占用问题

    只需要在一开机的极短时间内开启 sr 即可提前占用端口,而不是被占用

  9. C#数组 修改

    今天咱们了解下C#中的数组 后面会讲到集合.泛型集合 咱们分开来讲,免得出现混乱 讲完这三个,咱们再汇总一下,看看有什共同点和不同点 定义一个数组: ]; , , , , , , , , , }; 两 ...

  10. 大话 .Net 之内存管理

    在一次偶然的机会中,我来到了恒生的大家庭.又在一次偶然的机会中,我很荣幸的被勇哥信任并让我写一篇季刊的文章.可能人生之中充满了无数次的偶然机会,我们只有抓住眼前的“偶然”,才可以创建人生.当我接到这个 ...