AttributeError: module ‘tensorflow.python.ops.nn’ has no attribute ‘leaky_relu’

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

搞定~~

posted @ 2018-06-25 20:33  恩zzq我是  阅读(11385)  评论(0编辑  收藏  举报