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

搞定~~

猜你喜欢

转载自www.cnblogs.com/zzq-123456/p/9226168.html