when i start fitting my model , my model acc going to 99% but validation_acc still fluctuating , how can i fix that.i try Normalization layers before fit() , but didn't fix that.
--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/ea045d2a-385a-4dea-8b62-30f70a7027ben%40googlegroups.com.
when i start fitting my model , my model acc going to 99% but validation_acc still fluctuating , how can i fix that.i try Normalization layers before fit() , but didn't fix that.
--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/ea045d2a-385a-4dea-8b62-30f70a7027ben%40googlegroups.com.
Yes i have divided the data to Train set , validation set , test set and fitting the model with train data and validation data.I have a total of 1800 person face data, which is divided into three classes, because I have a picture of three people
And I've divided this into training data, validation data, and test data.
Education: 900 pieces of data (300 pieces per class)
Validation: 450 pieces of data (150 pieces per class)
Test: 450 pieces of data (150 pieces per class)this is my plot:model architecture:# Data Preproccessing:train_datagen = ImageDataGenerator(rescale = 1./255,rotation_range = 40,width_shift_range = 0.2,height_shift_range = 0.2,shear_range = 0.2,zoom_range = 0.2,horizontal_flip = True,vertical_flip = True)test_datagen = ImageDataGenerator(rescale=1./255)train_generator = train_datagen.flow_from_directory(train_dir,target_size=(150,150),batch_size=32,class_mode="categorical",shuffle=True)validation_generator = test_datagen.flow_from_directory(validation_dir,target_size=(150,150),batch_size=32,class_mode="categorical",shuffle=True)# Netwrok Architecture:conv_base = VGG16(pooling="max",include_top=False,weights="imagenet",input_shape=(150,150,3))Network = models.Sequential()Network.add(conv_base)Network.add(layers.Dense(8500,activation="elu",kernel_regularizer=regularizers.l1(0.001)))Network.add(layers.Dropout(0.4))Network.add(layers.Dense(3,activation="softmax"))Network.compile(optimizer=optimizers.RMSprop(learning_rate=0.0001),loss="categorical_crossentropy",metrics=['accuracy'])Network.layers[0].trainable = Falseresult = Network.fit(train_generator,steps_per_epoch=28,epochs=38,validation_data=validation_generator,validation_steps=14)This is my last epochs log:Epoch 35/45 28/28 [==============================] - 33s 1s/step - loss: 0.4564 - accuracy: 0.9839 - val_loss: 0.5221 - val_accuracy: 0.9621 Epoch 36/45 28/28 [==============================] - 33s 1s/step - loss: 0.6338 - accuracy: 0.9551 - val_loss: 1.4283 - val_accuracy: 0.7857 Epoch 37/45 28/28 [==============================] - 33s 1s/step - loss: 0.8284 - accuracy: 0.9574 - val_loss: 1.1220 - val_accuracy: 0.8929 Epoch 38/45 28/28 [==============================] - 34s 1s/step - loss: 0.3888 - accuracy: 1.0000 - val_loss: 1.3512 - val_accuracy: 0.8571 Epoch 39/45 28/28 [==============================] - 33s 1s/step - loss: 1.3770 - accuracy: 0.9424 - val_loss: 0.6160 - val_accuracy: 0.9040 Epoch 40/45 28/28 [==============================] - 33s 1s/step - loss: 0.4311 - accuracy: 0.9781 - val_loss: 0.4648 - val_accuracy: 0.9554 Epoch 41/45 28/28 [==============================] - 33s 1s/step - loss: 0.3741 - accuracy: 0.9931 - val_loss: 0.6041 - val_accuracy: 0.9442 Epoch 42/45 28/28 [==============================] - 33s 1s/step - loss: 0.9070 - accuracy: 0.9551 - val_loss: 0.6701 - val_accuracy: 0.8549 Epoch 43/45 28/28 [==============================] - 33s 1s/step - loss: 0.3771 - accuracy: 0.9873 - val_loss: 2.2323 - val_accuracy: 0.6853 Epoch 44/45 28/28 [==============================] - 32s 1s/step - loss: 0.3730 - accuracy: 0.9896 - val_loss: 3.0664 - val_accuracy: 0.6763 Epoch 45/45 28/28 [==============================] - 33s 1s/step - loss: 0.8752 - accuracy: 0.9747 - val_loss: 4.6807 - val_accuracy: 0.6652i glad you can help me!!!
thank you !!
I will definitely try it !!!!but i have augmented images.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/CAP0ykh_P%2BF0qo0WZsnuxTJfYS79gjLUhZ4%3D8a-c_n5Ba8Q5QoQ%40mail.gmail.com.