直接叙述问题,在模型训练过程中, 出现准确率为0.0000e+00 (using Keras)的情况,查找了很多原因,初步确定问题出在数据集处理不恰当,导致计算损失过程中, 要么是0,要么是1.
下面贴出在 Stack Overflow上查找的可能原因:
My recommendations regarding the issue:
- try different optimizers, f.e. sgd, nadam, adam...
- scale you data differently, f.e. try these ranges [0,1] or [-1,1],
- Also, in my case the learning rate parameter was the critical one.
- and the most important thing:
always check for NaNs or inf in your dataset.
解决方案:
重新处理数据集中的数据,将可能含有NaN的数值进行填0处理。此处可能只是导致该问题的一个原因之一,其他情况请读者继续根据模型进行调整。