Val_loss非常高(超过100)。

问题描述 投票:0回答:1

我正在尝试创建一个用于图像分类的神经网络。这是我的 模型摘要. 我已经对我的数据集进行了归一化,并对我的数据进行了洗牌。. 当我运行model.fit时,val_loss非常高,有时接近100,而我的损失小于0.8。

image-processing keras tensorflow2.0 keras-layer tensorflow-datasets
1个回答
0
投票

当你不对测试数据进行归一化处理时,与经过归一化处理的训练数据相比,验证损失会非常高。我用简单的mnist模型来证明归一化的意义。

(x_train, y_train), (x_test, y_test) = mnist.load_data()
# this is to demonstrate the importance of normalizing both training and testing data
x_train, x_test = x_train / 255.0, x_test / 1.

当我们不对测试数据进行归一化,而对训练数据进行归一化的时候,训练损失会非常大。loss: 0.0771 其中,测试期间的损失为 13.1599. 请检查完整 代码在此. 谢谢!

© www.soinside.com 2019 - 2024. All rights reserved.