loss一直为nan

模型训练时loss一直为nan

解决方法:

1)检查是否安装keras-contrib

安装:pip install git+https://www.github.com/farizrahman4u/keras-contrib.git

2)尝试把后端改为tensorflow

参考https://blog.csdn.net/Treasure_Z/article/details/78853265,keras-contrib在theano后端不work

修改C:\Users\Administrator\.keras中keras.json,{"floatx": "float32", "epsilon": 1e-07, "backend": "tensorflow"}

theano改成tensorflow

你可能感兴趣的:(loss一直为nan)