训练期间的TF / Keras空片杀害损失平均值

时间:2019-01-16 18:28:40

标签: python tensorflow keras

有人在Keras / Tensorflow模型训练中看到此问题,它显示RuntimeWarning: Mean of empty slice.,然后损失计算显示 nan ,然后准确性下降,无法恢复。

---这是日志输出-----

Epoch 9701/9701 [==============================] - 1s 111us/step - loss: 0.0830 - acc: 0.9790 - val_loss: 6.6692 - val_acc: 0.3525

Epoch 63/1000
9701/9701 [==============================] - 1s 113us/step - loss: 0.0824 - acc: 0.9784 - val_loss: 6.8110 - val_acc: 0.3469

Epoch 64/1000

/home/anatolii/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py:2920: **RuntimeWarning: Mean of empty slice**.
  out=out, **kwargs)

/home/anatolii/.local/lib/python3.6/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in true_divide
  ret = ret.dtype.type(ret / rcount)

9701/9701 [==============================] - 1s 56us/step - loss: **nan** - acc: 0.9488 - val_loss: 15.7643 - val_acc: **0.0000e+00**

Epoch 65/1000
9701/9701 [==============================] - 0s 44us/step - loss: **nan** - acc: 0.9349 - val_loss: 15.9566 - val_acc: **0.0000e+00**
Epoch 66/1000

任何帮助将不胜感激。

0 个答案:

没有答案